1#![doc = "MAVLink ualberta dialect."]
2#![doc = ""]
3#![doc = "This file was automatically generated, do not edit."]
4#![allow(deprecated)]
5#[cfg(feature = "arbitrary")]
6use arbitrary::Arbitrary;
7#[allow(unused_imports)]
8use bitflags::bitflags;
9use mavlink_core::{
10 bytes::Bytes, bytes_mut::BytesMut, types::CharArray, MavlinkVersion, Message, MessageData,
11};
12#[allow(unused_imports)]
13use num_derive::FromPrimitive;
14#[allow(unused_imports)]
15use num_derive::ToPrimitive;
16#[allow(unused_imports)]
17use num_traits::FromPrimitive;
18#[allow(unused_imports)]
19use num_traits::ToPrimitive;
20#[cfg(feature = "serde")]
21use serde::{Deserialize, Serialize};
22#[cfg(feature = "ts")]
23use ts_rs::TS;
24pub const MINOR_MAVLINK_VERSION: u8 = 3u8;
25#[cfg_attr(feature = "ts", derive(TS))]
26#[cfg_attr(feature = "ts", ts(export))]
27#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
28#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29#[cfg_attr(feature = "serde", serde(tag = "type"))]
30#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31#[repr(u32)]
32#[doc = "Actuator configuration, used to change a setting on an actuator. Component information metadata can be used to know which outputs support which commands."]
33pub enum ActuatorConfiguration {
34 #[doc = "Do nothing."]
35 ACTUATOR_CONFIGURATION_NONE = 0,
36 #[doc = "Command the actuator to beep now."]
37 ACTUATOR_CONFIGURATION_BEEP = 1,
38 #[doc = "Permanently set the actuator (ESC) to 3D mode (reversible thrust)."]
39 ACTUATOR_CONFIGURATION_3D_MODE_ON = 2,
40 #[doc = "Permanently set the actuator (ESC) to non 3D mode (non-reversible thrust)."]
41 ACTUATOR_CONFIGURATION_3D_MODE_OFF = 3,
42 #[doc = "Permanently set the actuator (ESC) to spin direction 1 (which can be clockwise or counter-clockwise)."]
43 ACTUATOR_CONFIGURATION_SPIN_DIRECTION1 = 4,
44 #[doc = "Permanently set the actuator (ESC) to spin direction 2 (opposite of direction 1)."]
45 ACTUATOR_CONFIGURATION_SPIN_DIRECTION2 = 5,
46}
47impl ActuatorConfiguration {
48 pub const DEFAULT: Self = Self::ACTUATOR_CONFIGURATION_NONE;
49}
50impl Default for ActuatorConfiguration {
51 fn default() -> Self {
52 Self::DEFAULT
53 }
54}
55#[cfg_attr(feature = "ts", derive(TS))]
56#[cfg_attr(feature = "ts", ts(export))]
57#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
58#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
59#[cfg_attr(feature = "serde", serde(tag = "type"))]
60#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
61#[repr(u32)]
62#[doc = "Actuator output function. Values greater or equal to 1000 are autopilot-specific."]
63pub enum ActuatorOutputFunction {
64 #[doc = "No function (disabled)."]
65 ACTUATOR_OUTPUT_FUNCTION_NONE = 0,
66 #[doc = "Motor 1"]
67 ACTUATOR_OUTPUT_FUNCTION_MOTOR1 = 1,
68 #[doc = "Motor 2"]
69 ACTUATOR_OUTPUT_FUNCTION_MOTOR2 = 2,
70 #[doc = "Motor 3"]
71 ACTUATOR_OUTPUT_FUNCTION_MOTOR3 = 3,
72 #[doc = "Motor 4"]
73 ACTUATOR_OUTPUT_FUNCTION_MOTOR4 = 4,
74 #[doc = "Motor 5"]
75 ACTUATOR_OUTPUT_FUNCTION_MOTOR5 = 5,
76 #[doc = "Motor 6"]
77 ACTUATOR_OUTPUT_FUNCTION_MOTOR6 = 6,
78 #[doc = "Motor 7"]
79 ACTUATOR_OUTPUT_FUNCTION_MOTOR7 = 7,
80 #[doc = "Motor 8"]
81 ACTUATOR_OUTPUT_FUNCTION_MOTOR8 = 8,
82 #[doc = "Motor 9"]
83 ACTUATOR_OUTPUT_FUNCTION_MOTOR9 = 9,
84 #[doc = "Motor 10"]
85 ACTUATOR_OUTPUT_FUNCTION_MOTOR10 = 10,
86 #[doc = "Motor 11"]
87 ACTUATOR_OUTPUT_FUNCTION_MOTOR11 = 11,
88 #[doc = "Motor 12"]
89 ACTUATOR_OUTPUT_FUNCTION_MOTOR12 = 12,
90 #[doc = "Motor 13"]
91 ACTUATOR_OUTPUT_FUNCTION_MOTOR13 = 13,
92 #[doc = "Motor 14"]
93 ACTUATOR_OUTPUT_FUNCTION_MOTOR14 = 14,
94 #[doc = "Motor 15"]
95 ACTUATOR_OUTPUT_FUNCTION_MOTOR15 = 15,
96 #[doc = "Motor 16"]
97 ACTUATOR_OUTPUT_FUNCTION_MOTOR16 = 16,
98 #[doc = "Servo 1"]
99 ACTUATOR_OUTPUT_FUNCTION_SERVO1 = 33,
100 #[doc = "Servo 2"]
101 ACTUATOR_OUTPUT_FUNCTION_SERVO2 = 34,
102 #[doc = "Servo 3"]
103 ACTUATOR_OUTPUT_FUNCTION_SERVO3 = 35,
104 #[doc = "Servo 4"]
105 ACTUATOR_OUTPUT_FUNCTION_SERVO4 = 36,
106 #[doc = "Servo 5"]
107 ACTUATOR_OUTPUT_FUNCTION_SERVO5 = 37,
108 #[doc = "Servo 6"]
109 ACTUATOR_OUTPUT_FUNCTION_SERVO6 = 38,
110 #[doc = "Servo 7"]
111 ACTUATOR_OUTPUT_FUNCTION_SERVO7 = 39,
112 #[doc = "Servo 8"]
113 ACTUATOR_OUTPUT_FUNCTION_SERVO8 = 40,
114 #[doc = "Servo 9"]
115 ACTUATOR_OUTPUT_FUNCTION_SERVO9 = 41,
116 #[doc = "Servo 10"]
117 ACTUATOR_OUTPUT_FUNCTION_SERVO10 = 42,
118 #[doc = "Servo 11"]
119 ACTUATOR_OUTPUT_FUNCTION_SERVO11 = 43,
120 #[doc = "Servo 12"]
121 ACTUATOR_OUTPUT_FUNCTION_SERVO12 = 44,
122 #[doc = "Servo 13"]
123 ACTUATOR_OUTPUT_FUNCTION_SERVO13 = 45,
124 #[doc = "Servo 14"]
125 ACTUATOR_OUTPUT_FUNCTION_SERVO14 = 46,
126 #[doc = "Servo 15"]
127 ACTUATOR_OUTPUT_FUNCTION_SERVO15 = 47,
128 #[doc = "Servo 16"]
129 ACTUATOR_OUTPUT_FUNCTION_SERVO16 = 48,
130}
131impl ActuatorOutputFunction {
132 pub const DEFAULT: Self = Self::ACTUATOR_OUTPUT_FUNCTION_NONE;
133}
134impl Default for ActuatorOutputFunction {
135 fn default() -> Self {
136 Self::DEFAULT
137 }
138}
139#[cfg_attr(feature = "ts", derive(TS))]
140#[cfg_attr(feature = "ts", ts(export))]
141#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
142#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
143#[cfg_attr(feature = "serde", serde(tag = "type"))]
144#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
145#[repr(u32)]
146#[doc = "Enumeration of the ADSB altimeter types"]
147pub enum AdsbAltitudeType {
148 #[doc = "Altitude reported from a Baro source using QNH reference"]
149 ADSB_ALTITUDE_TYPE_PRESSURE_QNH = 0,
150 #[doc = "Altitude reported from a GNSS source"]
151 ADSB_ALTITUDE_TYPE_GEOMETRIC = 1,
152}
153impl AdsbAltitudeType {
154 pub const DEFAULT: Self = Self::ADSB_ALTITUDE_TYPE_PRESSURE_QNH;
155}
156impl Default for AdsbAltitudeType {
157 fn default() -> Self {
158 Self::DEFAULT
159 }
160}
161#[cfg_attr(feature = "ts", derive(TS))]
162#[cfg_attr(feature = "ts", ts(export))]
163#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
164#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
165#[cfg_attr(feature = "serde", serde(tag = "type"))]
166#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
167#[repr(u32)]
168#[doc = "ADSB classification for the type of vehicle emitting the transponder signal"]
169pub enum AdsbEmitterType {
170 ADSB_EMITTER_TYPE_NO_INFO = 0,
171 ADSB_EMITTER_TYPE_LIGHT = 1,
172 ADSB_EMITTER_TYPE_SMALL = 2,
173 ADSB_EMITTER_TYPE_LARGE = 3,
174 ADSB_EMITTER_TYPE_HIGH_VORTEX_LARGE = 4,
175 ADSB_EMITTER_TYPE_HEAVY = 5,
176 ADSB_EMITTER_TYPE_HIGHLY_MANUV = 6,
177 ADSB_EMITTER_TYPE_ROTOCRAFT = 7,
178 ADSB_EMITTER_TYPE_UNASSIGNED = 8,
179 ADSB_EMITTER_TYPE_GLIDER = 9,
180 ADSB_EMITTER_TYPE_LIGHTER_AIR = 10,
181 ADSB_EMITTER_TYPE_PARACHUTE = 11,
182 ADSB_EMITTER_TYPE_ULTRA_LIGHT = 12,
183 ADSB_EMITTER_TYPE_UNASSIGNED2 = 13,
184 ADSB_EMITTER_TYPE_UAV = 14,
185 ADSB_EMITTER_TYPE_SPACE = 15,
186 ADSB_EMITTER_TYPE_UNASSGINED3 = 16,
187 ADSB_EMITTER_TYPE_EMERGENCY_SURFACE = 17,
188 ADSB_EMITTER_TYPE_SERVICE_SURFACE = 18,
189 ADSB_EMITTER_TYPE_POINT_OBSTACLE = 19,
190}
191impl AdsbEmitterType {
192 pub const DEFAULT: Self = Self::ADSB_EMITTER_TYPE_NO_INFO;
193}
194impl Default for AdsbEmitterType {
195 fn default() -> Self {
196 Self::DEFAULT
197 }
198}
199bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags indicate status such as data validity of each data source. Set = data valid"] pub struct AdsbFlags : u16 { const ADSB_FLAGS_VALID_COORDS = 1 ; const ADSB_FLAGS_VALID_ALTITUDE = 2 ; const ADSB_FLAGS_VALID_HEADING = 4 ; const ADSB_FLAGS_VALID_VELOCITY = 8 ; const ADSB_FLAGS_VALID_CALLSIGN = 16 ; const ADSB_FLAGS_VALID_SQUAWK = 32 ; const ADSB_FLAGS_SIMULATED = 64 ; const ADSB_FLAGS_VERTICAL_VELOCITY_VALID = 128 ; const ADSB_FLAGS_BARO_VALID = 256 ; const ADSB_FLAGS_SOURCE_UAT = 32768 ; } }
200impl AdsbFlags {
201 pub const DEFAULT: Self = Self::ADSB_FLAGS_VALID_COORDS;
202}
203impl Default for AdsbFlags {
204 fn default() -> Self {
205 Self::DEFAULT
206 }
207}
208bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags are used in the AIS_VESSEL.fields bitmask to indicate validity of data in the other message fields. When set, the data is valid."] pub struct AisFlags : u16 { # [doc = "1 = Position accuracy less than 10m, 0 = position accuracy greater than 10m."] const AIS_FLAGS_POSITION_ACCURACY = 1 ; const AIS_FLAGS_VALID_COG = 2 ; const AIS_FLAGS_VALID_VELOCITY = 4 ; # [doc = "1 = Velocity over 52.5765m/s (102.2 knots)"] const AIS_FLAGS_HIGH_VELOCITY = 8 ; const AIS_FLAGS_VALID_TURN_RATE = 16 ; # [doc = "Only the sign of the returned turn rate value is valid, either greater than 5deg/30s or less than -5deg/30s"] const AIS_FLAGS_TURN_RATE_SIGN_ONLY = 32 ; const AIS_FLAGS_VALID_DIMENSIONS = 64 ; # [doc = "Distance to bow is larger than 511m"] const AIS_FLAGS_LARGE_BOW_DIMENSION = 128 ; # [doc = "Distance to stern is larger than 511m"] const AIS_FLAGS_LARGE_STERN_DIMENSION = 256 ; # [doc = "Distance to port side is larger than 63m"] const AIS_FLAGS_LARGE_PORT_DIMENSION = 512 ; # [doc = "Distance to starboard side is larger than 63m"] const AIS_FLAGS_LARGE_STARBOARD_DIMENSION = 1024 ; const AIS_FLAGS_VALID_CALLSIGN = 2048 ; const AIS_FLAGS_VALID_NAME = 4096 ; } }
209impl AisFlags {
210 pub const DEFAULT: Self = Self::AIS_FLAGS_POSITION_ACCURACY;
211}
212impl Default for AisFlags {
213 fn default() -> Self {
214 Self::DEFAULT
215 }
216}
217#[cfg_attr(feature = "ts", derive(TS))]
218#[cfg_attr(feature = "ts", ts(export))]
219#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
220#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
221#[cfg_attr(feature = "serde", serde(tag = "type"))]
222#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
223#[repr(u32)]
224#[doc = "Navigational status of AIS vessel, enum duplicated from AIS standard, <https://gpsd.gitlab.io/gpsd/AIVDM.html>"]
225pub enum AisNavStatus {
226 #[doc = "Under way using engine."]
227 UNDER_WAY = 0,
228 AIS_NAV_ANCHORED = 1,
229 AIS_NAV_UN_COMMANDED = 2,
230 AIS_NAV_RESTRICTED_MANOEUVERABILITY = 3,
231 AIS_NAV_DRAUGHT_CONSTRAINED = 4,
232 AIS_NAV_MOORED = 5,
233 AIS_NAV_AGROUND = 6,
234 AIS_NAV_FISHING = 7,
235 AIS_NAV_SAILING = 8,
236 AIS_NAV_RESERVED_HSC = 9,
237 AIS_NAV_RESERVED_WIG = 10,
238 AIS_NAV_RESERVED_1 = 11,
239 AIS_NAV_RESERVED_2 = 12,
240 AIS_NAV_RESERVED_3 = 13,
241 #[doc = "Search And Rescue Transponder."]
242 AIS_NAV_AIS_SART = 14,
243 #[doc = "Not available (default)."]
244 AIS_NAV_UNKNOWN = 15,
245}
246impl AisNavStatus {
247 pub const DEFAULT: Self = Self::UNDER_WAY;
248}
249impl Default for AisNavStatus {
250 fn default() -> Self {
251 Self::DEFAULT
252 }
253}
254#[cfg_attr(feature = "ts", derive(TS))]
255#[cfg_attr(feature = "ts", ts(export))]
256#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
257#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
258#[cfg_attr(feature = "serde", serde(tag = "type"))]
259#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
260#[repr(u32)]
261#[doc = "Type of AIS vessel, enum duplicated from AIS standard, <https://gpsd.gitlab.io/gpsd/AIVDM.html>"]
262pub enum AisType {
263 #[doc = "Not available (default)."]
264 AIS_TYPE_UNKNOWN = 0,
265 AIS_TYPE_RESERVED_1 = 1,
266 AIS_TYPE_RESERVED_2 = 2,
267 AIS_TYPE_RESERVED_3 = 3,
268 AIS_TYPE_RESERVED_4 = 4,
269 AIS_TYPE_RESERVED_5 = 5,
270 AIS_TYPE_RESERVED_6 = 6,
271 AIS_TYPE_RESERVED_7 = 7,
272 AIS_TYPE_RESERVED_8 = 8,
273 AIS_TYPE_RESERVED_9 = 9,
274 AIS_TYPE_RESERVED_10 = 10,
275 AIS_TYPE_RESERVED_11 = 11,
276 AIS_TYPE_RESERVED_12 = 12,
277 AIS_TYPE_RESERVED_13 = 13,
278 AIS_TYPE_RESERVED_14 = 14,
279 AIS_TYPE_RESERVED_15 = 15,
280 AIS_TYPE_RESERVED_16 = 16,
281 AIS_TYPE_RESERVED_17 = 17,
282 AIS_TYPE_RESERVED_18 = 18,
283 AIS_TYPE_RESERVED_19 = 19,
284 #[doc = "Wing In Ground effect."]
285 AIS_TYPE_WIG = 20,
286 AIS_TYPE_WIG_HAZARDOUS_A = 21,
287 AIS_TYPE_WIG_HAZARDOUS_B = 22,
288 AIS_TYPE_WIG_HAZARDOUS_C = 23,
289 AIS_TYPE_WIG_HAZARDOUS_D = 24,
290 AIS_TYPE_WIG_RESERVED_1 = 25,
291 AIS_TYPE_WIG_RESERVED_2 = 26,
292 AIS_TYPE_WIG_RESERVED_3 = 27,
293 AIS_TYPE_WIG_RESERVED_4 = 28,
294 AIS_TYPE_WIG_RESERVED_5 = 29,
295 AIS_TYPE_FISHING = 30,
296 AIS_TYPE_TOWING = 31,
297 #[doc = "Towing: length exceeds 200m or breadth exceeds 25m."]
298 AIS_TYPE_TOWING_LARGE = 32,
299 #[doc = "Dredging or other underwater ops."]
300 AIS_TYPE_DREDGING = 33,
301 AIS_TYPE_DIVING = 34,
302 AIS_TYPE_MILITARY = 35,
303 AIS_TYPE_SAILING = 36,
304 AIS_TYPE_PLEASURE = 37,
305 AIS_TYPE_RESERVED_20 = 38,
306 AIS_TYPE_RESERVED_21 = 39,
307 #[doc = "High Speed Craft."]
308 AIS_TYPE_HSC = 40,
309 AIS_TYPE_HSC_HAZARDOUS_A = 41,
310 AIS_TYPE_HSC_HAZARDOUS_B = 42,
311 AIS_TYPE_HSC_HAZARDOUS_C = 43,
312 AIS_TYPE_HSC_HAZARDOUS_D = 44,
313 AIS_TYPE_HSC_RESERVED_1 = 45,
314 AIS_TYPE_HSC_RESERVED_2 = 46,
315 AIS_TYPE_HSC_RESERVED_3 = 47,
316 AIS_TYPE_HSC_RESERVED_4 = 48,
317 AIS_TYPE_HSC_UNKNOWN = 49,
318 AIS_TYPE_PILOT = 50,
319 #[doc = "Search And Rescue vessel."]
320 AIS_TYPE_SAR = 51,
321 AIS_TYPE_TUG = 52,
322 AIS_TYPE_PORT_TENDER = 53,
323 #[doc = "Anti-pollution equipment."]
324 AIS_TYPE_ANTI_POLLUTION = 54,
325 AIS_TYPE_LAW_ENFORCEMENT = 55,
326 AIS_TYPE_SPARE_LOCAL_1 = 56,
327 AIS_TYPE_SPARE_LOCAL_2 = 57,
328 AIS_TYPE_MEDICAL_TRANSPORT = 58,
329 #[doc = "Noncombatant ship according to RR Resolution No. 18."]
330 AIS_TYPE_NONECOMBATANT = 59,
331 AIS_TYPE_PASSENGER = 60,
332 AIS_TYPE_PASSENGER_HAZARDOUS_A = 61,
333 AIS_TYPE_PASSENGER_HAZARDOUS_B = 62,
334 AIS_TYPE_PASSENGER_HAZARDOUS_C = 63,
335 AIS_TYPE_PASSENGER_HAZARDOUS_D = 64,
336 AIS_TYPE_PASSENGER_RESERVED_1 = 65,
337 AIS_TYPE_PASSENGER_RESERVED_2 = 66,
338 AIS_TYPE_PASSENGER_RESERVED_3 = 67,
339 AIS_TYPE_PASSENGER_RESERVED_4 = 68,
340 AIS_TYPE_PASSENGER_UNKNOWN = 69,
341 AIS_TYPE_CARGO = 70,
342 AIS_TYPE_CARGO_HAZARDOUS_A = 71,
343 AIS_TYPE_CARGO_HAZARDOUS_B = 72,
344 AIS_TYPE_CARGO_HAZARDOUS_C = 73,
345 AIS_TYPE_CARGO_HAZARDOUS_D = 74,
346 AIS_TYPE_CARGO_RESERVED_1 = 75,
347 AIS_TYPE_CARGO_RESERVED_2 = 76,
348 AIS_TYPE_CARGO_RESERVED_3 = 77,
349 AIS_TYPE_CARGO_RESERVED_4 = 78,
350 AIS_TYPE_CARGO_UNKNOWN = 79,
351 AIS_TYPE_TANKER = 80,
352 AIS_TYPE_TANKER_HAZARDOUS_A = 81,
353 AIS_TYPE_TANKER_HAZARDOUS_B = 82,
354 AIS_TYPE_TANKER_HAZARDOUS_C = 83,
355 AIS_TYPE_TANKER_HAZARDOUS_D = 84,
356 AIS_TYPE_TANKER_RESERVED_1 = 85,
357 AIS_TYPE_TANKER_RESERVED_2 = 86,
358 AIS_TYPE_TANKER_RESERVED_3 = 87,
359 AIS_TYPE_TANKER_RESERVED_4 = 88,
360 AIS_TYPE_TANKER_UNKNOWN = 89,
361 AIS_TYPE_OTHER = 90,
362 AIS_TYPE_OTHER_HAZARDOUS_A = 91,
363 AIS_TYPE_OTHER_HAZARDOUS_B = 92,
364 AIS_TYPE_OTHER_HAZARDOUS_C = 93,
365 AIS_TYPE_OTHER_HAZARDOUS_D = 94,
366 AIS_TYPE_OTHER_RESERVED_1 = 95,
367 AIS_TYPE_OTHER_RESERVED_2 = 96,
368 AIS_TYPE_OTHER_RESERVED_3 = 97,
369 AIS_TYPE_OTHER_RESERVED_4 = 98,
370 AIS_TYPE_OTHER_UNKNOWN = 99,
371}
372impl AisType {
373 pub const DEFAULT: Self = Self::AIS_TYPE_UNKNOWN;
374}
375impl Default for AisType {
376 fn default() -> Self {
377 Self::DEFAULT
378 }
379}
380bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmap to indicate which dimensions should be ignored by the vehicle: a value of 0b00000000 indicates that none of the setpoint dimensions should be ignored."] pub struct AttitudeTargetTypemask : u8 { # [doc = "Ignore body roll rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_ROLL_RATE_IGNORE = 1 ; # [doc = "Ignore body pitch rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_PITCH_RATE_IGNORE = 2 ; # [doc = "Ignore body yaw rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_YAW_RATE_IGNORE = 4 ; # [doc = "Use 3D body thrust setpoint instead of throttle"] const ATTITUDE_TARGET_TYPEMASK_THRUST_BODY_SET = 32 ; # [doc = "Ignore throttle"] const ATTITUDE_TARGET_TYPEMASK_THROTTLE_IGNORE = 64 ; # [doc = "Ignore attitude"] const ATTITUDE_TARGET_TYPEMASK_ATTITUDE_IGNORE = 128 ; } }
381impl AttitudeTargetTypemask {
382 pub const DEFAULT: Self = Self::ATTITUDE_TARGET_TYPEMASK_BODY_ROLL_RATE_IGNORE;
383}
384impl Default for AttitudeTargetTypemask {
385 fn default() -> Self {
386 Self::DEFAULT
387 }
388}
389#[cfg_attr(feature = "ts", derive(TS))]
390#[cfg_attr(feature = "ts", ts(export))]
391#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
392#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
393#[cfg_attr(feature = "serde", serde(tag = "type"))]
394#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
395#[repr(u32)]
396#[doc = "Axes that will be autotuned by MAV_CMD_DO_AUTOTUNE_ENABLE. Note that at least one flag must be set in MAV_CMD_DO_AUTOTUNE_ENABLE.param2: if none are set, the flight stack will tune its default set of axes."]
397pub enum AutotuneAxis {
398 #[doc = "Autotune roll axis."]
399 AUTOTUNE_AXIS_ROLL = 1,
400 #[doc = "Autotune pitch axis."]
401 AUTOTUNE_AXIS_PITCH = 2,
402 #[doc = "Autotune yaw axis."]
403 AUTOTUNE_AXIS_YAW = 4,
404}
405impl AutotuneAxis {
406 pub const DEFAULT: Self = Self::AUTOTUNE_AXIS_ROLL;
407}
408impl Default for AutotuneAxis {
409 fn default() -> Self {
410 Self::DEFAULT
411 }
412}
413bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Camera capability flags (Bitmap)"] pub struct CameraCapFlags : u32 { # [doc = "Camera is able to record video"] const CAMERA_CAP_FLAGS_CAPTURE_VIDEO = 1 ; # [doc = "Camera is able to capture images"] const CAMERA_CAP_FLAGS_CAPTURE_IMAGE = 2 ; # [doc = "Camera has separate Video and Image/Photo modes (MAV_CMD_SET_CAMERA_MODE)"] const CAMERA_CAP_FLAGS_HAS_MODES = 4 ; # [doc = "Camera can capture images while in video mode"] const CAMERA_CAP_FLAGS_CAN_CAPTURE_IMAGE_IN_VIDEO_MODE = 8 ; # [doc = "Camera can capture videos while in Photo/Image mode"] const CAMERA_CAP_FLAGS_CAN_CAPTURE_VIDEO_IN_IMAGE_MODE = 16 ; # [doc = "Camera has image survey mode (MAV_CMD_SET_CAMERA_MODE)"] const CAMERA_CAP_FLAGS_HAS_IMAGE_SURVEY_MODE = 32 ; # [doc = "Camera has basic zoom control (MAV_CMD_SET_CAMERA_ZOOM)"] const CAMERA_CAP_FLAGS_HAS_BASIC_ZOOM = 64 ; # [doc = "Camera has basic focus control (MAV_CMD_SET_CAMERA_FOCUS)"] const CAMERA_CAP_FLAGS_HAS_BASIC_FOCUS = 128 ; # [doc = "Camera has video streaming capabilities (request VIDEO_STREAM_INFORMATION with MAV_CMD_REQUEST_MESSAGE for video streaming info)"] const CAMERA_CAP_FLAGS_HAS_VIDEO_STREAM = 256 ; # [doc = "Camera supports tracking of a point on the camera view."] const CAMERA_CAP_FLAGS_HAS_TRACKING_POINT = 512 ; # [doc = "Camera supports tracking of a selection rectangle on the camera view."] const CAMERA_CAP_FLAGS_HAS_TRACKING_RECTANGLE = 1024 ; # [doc = "Camera supports tracking geo status (CAMERA_TRACKING_GEO_STATUS)."] const CAMERA_CAP_FLAGS_HAS_TRACKING_GEO_STATUS = 2048 ; # [doc = "Camera supports absolute thermal range (request CAMERA_THERMAL_RANGE with MAV_CMD_REQUEST_MESSAGE)."] const CAMERA_CAP_FLAGS_HAS_THERMAL_RANGE = 4096 ; } }
414impl CameraCapFlags {
415 pub const DEFAULT: Self = Self::CAMERA_CAP_FLAGS_CAPTURE_VIDEO;
416}
417impl Default for CameraCapFlags {
418 fn default() -> Self {
419 Self::DEFAULT
420 }
421}
422#[cfg_attr(feature = "ts", derive(TS))]
423#[cfg_attr(feature = "ts", ts(export))]
424#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
425#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
426#[cfg_attr(feature = "serde", serde(tag = "type"))]
427#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
428#[repr(u32)]
429#[doc = "Camera Modes."]
430pub enum CameraMode {
431 #[doc = "Camera is in image/photo capture mode."]
432 CAMERA_MODE_IMAGE = 0,
433 #[doc = "Camera is in video capture mode."]
434 CAMERA_MODE_VIDEO = 1,
435 #[doc = "Camera is in image survey capture mode. It allows for camera controller to do specific settings for surveys."]
436 CAMERA_MODE_IMAGE_SURVEY = 2,
437}
438impl CameraMode {
439 pub const DEFAULT: Self = Self::CAMERA_MODE_IMAGE;
440}
441impl Default for CameraMode {
442 fn default() -> Self {
443 Self::DEFAULT
444 }
445}
446#[cfg_attr(feature = "ts", derive(TS))]
447#[cfg_attr(feature = "ts", ts(export))]
448#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
449#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
450#[cfg_attr(feature = "serde", serde(tag = "type"))]
451#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
452#[repr(u32)]
453#[doc = "Camera sources for MAV_CMD_SET_CAMERA_SOURCE"]
454pub enum CameraSource {
455 #[doc = "Default camera source."]
456 CAMERA_SOURCE_DEFAULT = 0,
457 #[doc = "RGB camera source."]
458 CAMERA_SOURCE_RGB = 1,
459 #[doc = "IR camera source."]
460 CAMERA_SOURCE_IR = 2,
461 #[doc = "NDVI camera source."]
462 CAMERA_SOURCE_NDVI = 3,
463}
464impl CameraSource {
465 pub const DEFAULT: Self = Self::CAMERA_SOURCE_DEFAULT;
466}
467impl Default for CameraSource {
468 fn default() -> Self {
469 Self::DEFAULT
470 }
471}
472#[cfg_attr(feature = "ts", derive(TS))]
473#[cfg_attr(feature = "ts", ts(export))]
474#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
475#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
476#[cfg_attr(feature = "serde", serde(tag = "type"))]
477#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
478#[repr(u32)]
479#[doc = "Camera tracking modes"]
480pub enum CameraTrackingMode {
481 #[doc = "Not tracking"]
482 CAMERA_TRACKING_MODE_NONE = 0,
483 #[doc = "Target is a point"]
484 CAMERA_TRACKING_MODE_POINT = 1,
485 #[doc = "Target is a rectangle"]
486 CAMERA_TRACKING_MODE_RECTANGLE = 2,
487}
488impl CameraTrackingMode {
489 pub const DEFAULT: Self = Self::CAMERA_TRACKING_MODE_NONE;
490}
491impl Default for CameraTrackingMode {
492 fn default() -> Self {
493 Self::DEFAULT
494 }
495}
496#[cfg_attr(feature = "ts", derive(TS))]
497#[cfg_attr(feature = "ts", ts(export))]
498#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
499#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
500#[cfg_attr(feature = "serde", serde(tag = "type"))]
501#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
502#[repr(u32)]
503#[doc = "Camera tracking status flags"]
504pub enum CameraTrackingStatusFlags {
505 #[doc = "Camera is not tracking"]
506 CAMERA_TRACKING_STATUS_FLAGS_IDLE = 0,
507 #[doc = "Camera is tracking"]
508 CAMERA_TRACKING_STATUS_FLAGS_ACTIVE = 1,
509 #[doc = "Camera tracking in error state"]
510 CAMERA_TRACKING_STATUS_FLAGS_ERROR = 2,
511}
512impl CameraTrackingStatusFlags {
513 pub const DEFAULT: Self = Self::CAMERA_TRACKING_STATUS_FLAGS_IDLE;
514}
515impl Default for CameraTrackingStatusFlags {
516 fn default() -> Self {
517 Self::DEFAULT
518 }
519}
520bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Camera tracking target data (shows where tracked target is within image)"] pub struct CameraTrackingTargetData : u8 { # [doc = "Target data embedded in image data (proprietary)"] const CAMERA_TRACKING_TARGET_DATA_EMBEDDED = 1 ; # [doc = "Target data rendered in image"] const CAMERA_TRACKING_TARGET_DATA_RENDERED = 2 ; # [doc = "Target data within status message (Point or Rectangle)"] const CAMERA_TRACKING_TARGET_DATA_IN_STATUS = 4 ; } }
521impl CameraTrackingTargetData {
522 pub const DEFAULT: Self = Self::CAMERA_TRACKING_TARGET_DATA_EMBEDDED;
523}
524impl Default for CameraTrackingTargetData {
525 fn default() -> Self {
526 Self::DEFAULT
527 }
528}
529#[cfg_attr(feature = "ts", derive(TS))]
530#[cfg_attr(feature = "ts", ts(export))]
531#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
532#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
533#[cfg_attr(feature = "serde", serde(tag = "type"))]
534#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
535#[repr(u32)]
536#[doc = "Zoom types for MAV_CMD_SET_CAMERA_ZOOM"]
537pub enum CameraZoomType {
538 #[doc = "Zoom one step increment (-1 for wide, 1 for tele)"]
539 ZOOM_TYPE_STEP = 0,
540 #[doc = "Continuous normalized zoom in/out rate until stopped. Range -1..1, negative: wide, positive: narrow/tele, 0 to stop zooming. Other values should be clipped to the range."]
541 ZOOM_TYPE_CONTINUOUS = 1,
542 #[doc = "Zoom value as proportion of full camera range (a percentage value between 0.0 and 100.0)"]
543 ZOOM_TYPE_RANGE = 2,
544 #[doc = "Zoom value/variable focal length in millimetres. Note that there is no message to get the valid zoom range of the camera, so this can type can only be used for cameras where the zoom range is known (implying that this cannot reliably be used in a GCS for an arbitrary camera)"]
545 ZOOM_TYPE_FOCAL_LENGTH = 3,
546 #[doc = "Zoom value as horizontal field of view in degrees."]
547 ZOOM_TYPE_HORIZONTAL_FOV = 4,
548}
549impl CameraZoomType {
550 pub const DEFAULT: Self = Self::ZOOM_TYPE_STEP;
551}
552impl Default for CameraZoomType {
553 fn default() -> Self {
554 Self::DEFAULT
555 }
556}
557#[cfg_attr(feature = "ts", derive(TS))]
558#[cfg_attr(feature = "ts", ts(export))]
559#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
560#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
561#[cfg_attr(feature = "serde", serde(tag = "type"))]
562#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
563#[repr(u32)]
564pub enum CanFilterOp {
565 CAN_FILTER_REPLACE = 0,
566 CAN_FILTER_ADD = 1,
567 CAN_FILTER_REMOVE = 2,
568}
569impl CanFilterOp {
570 pub const DEFAULT: Self = Self::CAN_FILTER_REPLACE;
571}
572impl Default for CanFilterOp {
573 fn default() -> Self {
574 Self::DEFAULT
575 }
576}
577#[cfg_attr(feature = "ts", derive(TS))]
578#[cfg_attr(feature = "ts", ts(export))]
579#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
580#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
581#[cfg_attr(feature = "serde", serde(tag = "type"))]
582#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
583#[repr(u32)]
584#[doc = "Possible responses from a CELLULAR_CONFIG message."]
585pub enum CellularConfigResponse {
586 #[doc = "Changes accepted."]
587 CELLULAR_CONFIG_RESPONSE_ACCEPTED = 0,
588 #[doc = "Invalid APN."]
589 CELLULAR_CONFIG_RESPONSE_APN_ERROR = 1,
590 #[doc = "Invalid PIN."]
591 CELLULAR_CONFIG_RESPONSE_PIN_ERROR = 2,
592 #[doc = "Changes rejected."]
593 CELLULAR_CONFIG_RESPONSE_REJECTED = 3,
594 #[doc = "PUK is required to unblock SIM card."]
595 CELLULAR_CONFIG_BLOCKED_PUK_REQUIRED = 4,
596}
597impl CellularConfigResponse {
598 pub const DEFAULT: Self = Self::CELLULAR_CONFIG_RESPONSE_ACCEPTED;
599}
600impl Default for CellularConfigResponse {
601 fn default() -> Self {
602 Self::DEFAULT
603 }
604}
605#[cfg_attr(feature = "ts", derive(TS))]
606#[cfg_attr(feature = "ts", ts(export))]
607#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
608#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
609#[cfg_attr(feature = "serde", serde(tag = "type"))]
610#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
611#[repr(u32)]
612#[doc = "These flags are used to diagnose the failure state of CELLULAR_STATUS"]
613pub enum CellularNetworkFailedReason {
614 #[doc = "No error"]
615 CELLULAR_NETWORK_FAILED_REASON_NONE = 0,
616 #[doc = "Error state is unknown"]
617 CELLULAR_NETWORK_FAILED_REASON_UNKNOWN = 1,
618 #[doc = "SIM is required for the modem but missing"]
619 CELLULAR_NETWORK_FAILED_REASON_SIM_MISSING = 2,
620 #[doc = "SIM is available, but not usable for connection"]
621 CELLULAR_NETWORK_FAILED_REASON_SIM_ERROR = 3,
622}
623impl CellularNetworkFailedReason {
624 pub const DEFAULT: Self = Self::CELLULAR_NETWORK_FAILED_REASON_NONE;
625}
626impl Default for CellularNetworkFailedReason {
627 fn default() -> Self {
628 Self::DEFAULT
629 }
630}
631#[cfg_attr(feature = "ts", derive(TS))]
632#[cfg_attr(feature = "ts", ts(export))]
633#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
634#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
635#[cfg_attr(feature = "serde", serde(tag = "type"))]
636#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
637#[repr(u32)]
638#[doc = "Cellular network radio type"]
639pub enum CellularNetworkRadioType {
640 CELLULAR_NETWORK_RADIO_TYPE_NONE = 0,
641 CELLULAR_NETWORK_RADIO_TYPE_GSM = 1,
642 CELLULAR_NETWORK_RADIO_TYPE_CDMA = 2,
643 CELLULAR_NETWORK_RADIO_TYPE_WCDMA = 3,
644 CELLULAR_NETWORK_RADIO_TYPE_LTE = 4,
645}
646impl CellularNetworkRadioType {
647 pub const DEFAULT: Self = Self::CELLULAR_NETWORK_RADIO_TYPE_NONE;
648}
649impl Default for CellularNetworkRadioType {
650 fn default() -> Self {
651 Self::DEFAULT
652 }
653}
654#[cfg_attr(feature = "ts", derive(TS))]
655#[cfg_attr(feature = "ts", ts(export))]
656#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
657#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
658#[cfg_attr(feature = "serde", serde(tag = "type"))]
659#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
660#[repr(u32)]
661#[doc = "These flags encode the cellular network status"]
662pub enum CellularStatusFlag {
663 #[doc = "State unknown or not reportable."]
664 CELLULAR_STATUS_FLAG_UNKNOWN = 0,
665 #[doc = "Modem is unusable"]
666 CELLULAR_STATUS_FLAG_FAILED = 1,
667 #[doc = "Modem is being initialized"]
668 CELLULAR_STATUS_FLAG_INITIALIZING = 2,
669 #[doc = "Modem is locked"]
670 CELLULAR_STATUS_FLAG_LOCKED = 3,
671 #[doc = "Modem is not enabled and is powered down"]
672 CELLULAR_STATUS_FLAG_DISABLED = 4,
673 #[doc = "Modem is currently transitioning to the CELLULAR_STATUS_FLAG_DISABLED state"]
674 CELLULAR_STATUS_FLAG_DISABLING = 5,
675 #[doc = "Modem is currently transitioning to the CELLULAR_STATUS_FLAG_ENABLED state"]
676 CELLULAR_STATUS_FLAG_ENABLING = 6,
677 #[doc = "Modem is enabled and powered on but not registered with a network provider and not available for data connections"]
678 CELLULAR_STATUS_FLAG_ENABLED = 7,
679 #[doc = "Modem is searching for a network provider to register"]
680 CELLULAR_STATUS_FLAG_SEARCHING = 8,
681 #[doc = "Modem is registered with a network provider, and data connections and messaging may be available for use"]
682 CELLULAR_STATUS_FLAG_REGISTERED = 9,
683 #[doc = "Modem is disconnecting and deactivating the last active packet data bearer. This state will not be entered if more than one packet data bearer is active and one of the active bearers is deactivated"]
684 CELLULAR_STATUS_FLAG_DISCONNECTING = 10,
685 #[doc = "Modem is activating and connecting the first packet data bearer. Subsequent bearer activations when another bearer is already active do not cause this state to be entered"]
686 CELLULAR_STATUS_FLAG_CONNECTING = 11,
687 #[doc = "One or more packet data bearers is active and connected"]
688 CELLULAR_STATUS_FLAG_CONNECTED = 12,
689}
690impl CellularStatusFlag {
691 pub const DEFAULT: Self = Self::CELLULAR_STATUS_FLAG_UNKNOWN;
692}
693impl Default for CellularStatusFlag {
694 fn default() -> Self {
695 Self::DEFAULT
696 }
697}
698#[cfg_attr(feature = "ts", derive(TS))]
699#[cfg_attr(feature = "ts", ts(export))]
700#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
701#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
702#[cfg_attr(feature = "serde", serde(tag = "type"))]
703#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
704#[repr(u32)]
705#[doc = "Supported component metadata types. These are used in the \"general\" metadata file returned by COMPONENT_METADATA to provide information about supported metadata types. The types are not used directly in MAVLink messages."]
706pub enum CompMetadataType {
707 #[doc = "General information about the component. General metadata includes information about other metadata types supported by the component. Files of this type must be supported, and must be downloadable from vehicle using a MAVLink FTP URI."]
708 COMP_METADATA_TYPE_GENERAL = 0,
709 #[doc = "Parameter meta data."]
710 COMP_METADATA_TYPE_PARAMETER = 1,
711 #[doc = "Meta data that specifies which commands and command parameters the vehicle supports. (WIP)"]
712 COMP_METADATA_TYPE_COMMANDS = 2,
713 #[doc = "Meta data that specifies external non-MAVLink peripherals."]
714 COMP_METADATA_TYPE_PERIPHERALS = 3,
715 #[doc = "Meta data for the events interface."]
716 COMP_METADATA_TYPE_EVENTS = 4,
717 #[doc = "Meta data for actuator configuration (motors, servos and vehicle geometry) and testing."]
718 COMP_METADATA_TYPE_ACTUATORS = 5,
719}
720impl CompMetadataType {
721 pub const DEFAULT: Self = Self::COMP_METADATA_TYPE_GENERAL;
722}
723impl Default for CompMetadataType {
724 fn default() -> Self {
725 Self::DEFAULT
726 }
727}
728#[cfg_attr(feature = "ts", derive(TS))]
729#[cfg_attr(feature = "ts", ts(export))]
730#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
731#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
732#[cfg_attr(feature = "serde", serde(tag = "type"))]
733#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
734#[repr(u32)]
735#[doc = "Indicates the ESC connection type."]
736pub enum EscConnectionType {
737 #[doc = "Traditional PPM ESC."]
738 ESC_CONNECTION_TYPE_PPM = 0,
739 #[doc = "Serial Bus connected ESC."]
740 ESC_CONNECTION_TYPE_SERIAL = 1,
741 #[doc = "One Shot PPM ESC."]
742 ESC_CONNECTION_TYPE_ONESHOT = 2,
743 #[doc = "I2C ESC."]
744 ESC_CONNECTION_TYPE_I2C = 3,
745 #[doc = "CAN-Bus ESC."]
746 ESC_CONNECTION_TYPE_CAN = 4,
747 #[doc = "DShot ESC."]
748 ESC_CONNECTION_TYPE_DSHOT = 5,
749}
750impl EscConnectionType {
751 pub const DEFAULT: Self = Self::ESC_CONNECTION_TYPE_PPM;
752}
753impl Default for EscConnectionType {
754 fn default() -> Self {
755 Self::DEFAULT
756 }
757}
758bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report ESC failures."] pub struct EscFailureFlags : u16 { # [doc = "Over current failure."] const ESC_FAILURE_OVER_CURRENT = 1 ; # [doc = "Over voltage failure."] const ESC_FAILURE_OVER_VOLTAGE = 2 ; # [doc = "Over temperature failure."] const ESC_FAILURE_OVER_TEMPERATURE = 4 ; # [doc = "Over RPM failure."] const ESC_FAILURE_OVER_RPM = 8 ; # [doc = "Inconsistent command failure i.e. out of bounds."] const ESC_FAILURE_INCONSISTENT_CMD = 16 ; # [doc = "Motor stuck failure."] const ESC_FAILURE_MOTOR_STUCK = 32 ; # [doc = "Generic ESC failure."] const ESC_FAILURE_GENERIC = 64 ; } }
759impl EscFailureFlags {
760 pub const DEFAULT: Self = Self::ESC_FAILURE_OVER_CURRENT;
761}
762impl Default for EscFailureFlags {
763 fn default() -> Self {
764 Self::DEFAULT
765 }
766}
767bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in ESTIMATOR_STATUS message"] pub struct EstimatorStatusFlags : u16 { # [doc = "True if the attitude estimate is good"] const ESTIMATOR_ATTITUDE = 1 ; # [doc = "True if the horizontal velocity estimate is good"] const ESTIMATOR_VELOCITY_HORIZ = 2 ; # [doc = "True if the vertical velocity estimate is good"] const ESTIMATOR_VELOCITY_VERT = 4 ; # [doc = "True if the horizontal position (relative) estimate is good"] const ESTIMATOR_POS_HORIZ_REL = 8 ; # [doc = "True if the horizontal position (absolute) estimate is good"] const ESTIMATOR_POS_HORIZ_ABS = 16 ; # [doc = "True if the vertical position (absolute) estimate is good"] const ESTIMATOR_POS_VERT_ABS = 32 ; # [doc = "True if the vertical position (above ground) estimate is good"] const ESTIMATOR_POS_VERT_AGL = 64 ; # [doc = "True if the EKF is in a constant position mode and is not using external measurements (eg GPS or optical flow)"] const ESTIMATOR_CONST_POS_MODE = 128 ; # [doc = "True if the EKF has sufficient data to enter a mode that will provide a (relative) position estimate"] const ESTIMATOR_PRED_POS_HORIZ_REL = 256 ; # [doc = "True if the EKF has sufficient data to enter a mode that will provide a (absolute) position estimate"] const ESTIMATOR_PRED_POS_HORIZ_ABS = 512 ; # [doc = "True if the EKF has detected a GPS glitch"] const ESTIMATOR_GPS_GLITCH = 1024 ; # [doc = "True if the EKF has detected bad accelerometer data"] const ESTIMATOR_ACCEL_ERROR = 2048 ; } }
768impl EstimatorStatusFlags {
769 pub const DEFAULT: Self = Self::ESTIMATOR_ATTITUDE;
770}
771impl Default for EstimatorStatusFlags {
772 fn default() -> Self {
773 Self::DEFAULT
774 }
775}
776#[cfg_attr(feature = "ts", derive(TS))]
777#[cfg_attr(feature = "ts", ts(export))]
778#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
779#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
780#[cfg_attr(feature = "serde", serde(tag = "type"))]
781#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
782#[repr(u32)]
783#[doc = "List of possible failure type to inject."]
784pub enum FailureType {
785 #[doc = "No failure injected, used to reset a previous failure."]
786 FAILURE_TYPE_OK = 0,
787 #[doc = "Sets unit off, so completely non-responsive."]
788 FAILURE_TYPE_OFF = 1,
789 #[doc = "Unit is stuck e.g. keeps reporting the same value."]
790 FAILURE_TYPE_STUCK = 2,
791 #[doc = "Unit is reporting complete garbage."]
792 FAILURE_TYPE_GARBAGE = 3,
793 #[doc = "Unit is consistently wrong."]
794 FAILURE_TYPE_WRONG = 4,
795 #[doc = "Unit is slow, so e.g. reporting at slower than expected rate."]
796 FAILURE_TYPE_SLOW = 5,
797 #[doc = "Data of unit is delayed in time."]
798 FAILURE_TYPE_DELAYED = 6,
799 #[doc = "Unit is sometimes working, sometimes not."]
800 FAILURE_TYPE_INTERMITTENT = 7,
801}
802impl FailureType {
803 pub const DEFAULT: Self = Self::FAILURE_TYPE_OK;
804}
805impl Default for FailureType {
806 fn default() -> Self {
807 Self::DEFAULT
808 }
809}
810#[cfg_attr(feature = "ts", derive(TS))]
811#[cfg_attr(feature = "ts", ts(export))]
812#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
813#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
814#[cfg_attr(feature = "serde", serde(tag = "type"))]
815#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
816#[repr(u32)]
817#[doc = "List of possible units where failures can be injected."]
818pub enum FailureUnit {
819 FAILURE_UNIT_SENSOR_GYRO = 0,
820 FAILURE_UNIT_SENSOR_ACCEL = 1,
821 FAILURE_UNIT_SENSOR_MAG = 2,
822 FAILURE_UNIT_SENSOR_BARO = 3,
823 FAILURE_UNIT_SENSOR_GPS = 4,
824 FAILURE_UNIT_SENSOR_OPTICAL_FLOW = 5,
825 FAILURE_UNIT_SENSOR_VIO = 6,
826 FAILURE_UNIT_SENSOR_DISTANCE_SENSOR = 7,
827 FAILURE_UNIT_SENSOR_AIRSPEED = 8,
828 FAILURE_UNIT_SYSTEM_BATTERY = 100,
829 FAILURE_UNIT_SYSTEM_MOTOR = 101,
830 FAILURE_UNIT_SYSTEM_SERVO = 102,
831 FAILURE_UNIT_SYSTEM_AVOIDANCE = 103,
832 FAILURE_UNIT_SYSTEM_RC_SIGNAL = 104,
833 FAILURE_UNIT_SYSTEM_MAVLINK_SIGNAL = 105,
834}
835impl FailureUnit {
836 pub const DEFAULT: Self = Self::FAILURE_UNIT_SENSOR_GYRO;
837}
838impl Default for FailureUnit {
839 fn default() -> Self {
840 Self::DEFAULT
841 }
842}
843#[cfg_attr(feature = "ts", derive(TS))]
844#[cfg_attr(feature = "ts", ts(export))]
845#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
846#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
847#[cfg_attr(feature = "serde", serde(tag = "type"))]
848#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
849#[repr(u32)]
850pub enum FenceBreach {
851 #[doc = "No last fence breach"]
852 FENCE_BREACH_NONE = 0,
853 #[doc = "Breached minimum altitude"]
854 FENCE_BREACH_MINALT = 1,
855 #[doc = "Breached maximum altitude"]
856 FENCE_BREACH_MAXALT = 2,
857 #[doc = "Breached fence boundary"]
858 FENCE_BREACH_BOUNDARY = 3,
859}
860impl FenceBreach {
861 pub const DEFAULT: Self = Self::FENCE_BREACH_NONE;
862}
863impl Default for FenceBreach {
864 fn default() -> Self {
865 Self::DEFAULT
866 }
867}
868#[cfg_attr(feature = "ts", derive(TS))]
869#[cfg_attr(feature = "ts", ts(export))]
870#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
871#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
872#[cfg_attr(feature = "serde", serde(tag = "type"))]
873#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
874#[repr(u32)]
875#[doc = "Actions being taken to mitigate/prevent fence breach"]
876pub enum FenceMitigate {
877 #[doc = "Unknown"]
878 FENCE_MITIGATE_UNKNOWN = 0,
879 #[doc = "No actions being taken"]
880 FENCE_MITIGATE_NONE = 1,
881 #[doc = "Velocity limiting active to prevent breach"]
882 FENCE_MITIGATE_VEL_LIMIT = 2,
883}
884impl FenceMitigate {
885 pub const DEFAULT: Self = Self::FENCE_MITIGATE_UNKNOWN;
886}
887impl Default for FenceMitigate {
888 fn default() -> Self {
889 Self::DEFAULT
890 }
891}
892#[cfg_attr(feature = "ts", derive(TS))]
893#[cfg_attr(feature = "ts", ts(export))]
894#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
895#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
896#[cfg_attr(feature = "serde", serde(tag = "type"))]
897#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
898#[repr(u32)]
899#[doc = "Fence types to enable or disable when using MAV_CMD_DO_FENCE_ENABLE. Note that at least one of these flags must be set in MAV_CMD_DO_FENCE_ENABLE.param2. If none are set, the flight stack will ignore the field and enable/disable its default set of fences (usually all of them)."]
900pub enum FenceType {
901 #[doc = "Maximum altitude fence"]
902 FENCE_TYPE_ALT_MAX = 1,
903 #[doc = "Circle fence"]
904 FENCE_TYPE_CIRCLE = 2,
905 #[doc = "Polygon fence"]
906 FENCE_TYPE_POLYGON = 4,
907 #[doc = "Minimum altitude fence"]
908 FENCE_TYPE_ALT_MIN = 8,
909}
910impl FenceType {
911 pub const DEFAULT: Self = Self::FENCE_TYPE_ALT_MAX;
912}
913impl Default for FenceType {
914 fn default() -> Self {
915 Self::DEFAULT
916 }
917}
918#[cfg_attr(feature = "ts", derive(TS))]
919#[cfg_attr(feature = "ts", ts(export))]
920#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
921#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
922#[cfg_attr(feature = "serde", serde(tag = "type"))]
923#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
924#[repr(u32)]
925#[doc = "These values define the type of firmware release. These values indicate the first version or release of this type. For example the first alpha release would be 64, the second would be 65."]
926pub enum FirmwareVersionType {
927 #[doc = "development release"]
928 FIRMWARE_VERSION_TYPE_DEV = 0,
929 #[doc = "alpha release"]
930 FIRMWARE_VERSION_TYPE_ALPHA = 64,
931 #[doc = "beta release"]
932 FIRMWARE_VERSION_TYPE_BETA = 128,
933 #[doc = "release candidate"]
934 FIRMWARE_VERSION_TYPE_RC = 192,
935 #[doc = "official stable release"]
936 FIRMWARE_VERSION_TYPE_OFFICIAL = 255,
937}
938impl FirmwareVersionType {
939 pub const DEFAULT: Self = Self::FIRMWARE_VERSION_TYPE_DEV;
940}
941impl Default for FirmwareVersionType {
942 fn default() -> Self {
943 Self::DEFAULT
944 }
945}
946bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal device (low level) capability flags (bitmap)."] pub struct GimbalDeviceCapFlags : u16 { # [doc = "Gimbal device supports a retracted position."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT = 1 ; # [doc = "Gimbal device supports a horizontal, forward looking position, stabilized."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_NEUTRAL = 2 ; # [doc = "Gimbal device supports rotating around roll axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_AXIS = 4 ; # [doc = "Gimbal device supports to follow a roll angle relative to the vehicle."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_FOLLOW = 8 ; # [doc = "Gimbal device supports locking to a roll angle (generally that's the default with roll stabilized)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_LOCK = 16 ; # [doc = "Gimbal device supports rotating around pitch axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_AXIS = 32 ; # [doc = "Gimbal device supports to follow a pitch angle relative to the vehicle."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_FOLLOW = 64 ; # [doc = "Gimbal device supports locking to a pitch angle (generally that's the default with pitch stabilized)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_LOCK = 128 ; # [doc = "Gimbal device supports rotating around yaw axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_AXIS = 256 ; # [doc = "Gimbal device supports to follow a yaw angle relative to the vehicle (generally that's the default)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_FOLLOW = 512 ; # [doc = "Gimbal device supports locking to an absolute heading, i.e., yaw angle relative to North (earth frame, often this is an option available)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_LOCK = 1024 ; # [doc = "Gimbal device supports yawing/panning infinitely (e.g. using slip disk)."] const GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_INFINITE_YAW = 2048 ; # [doc = "Gimbal device supports yaw angles and angular velocities relative to North (earth frame). This usually requires support by an autopilot via AUTOPILOT_STATE_FOR_GIMBAL_DEVICE. Support can go on and off during runtime, which is reported by the flag GIMBAL_DEVICE_FLAGS_CAN_ACCEPT_YAW_IN_EARTH_FRAME."] const GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME = 4096 ; # [doc = "Gimbal device supports radio control inputs as an alternative input for controlling the gimbal orientation."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_RC_INPUTS = 8192 ; } }
947impl GimbalDeviceCapFlags {
948 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT;
949}
950impl Default for GimbalDeviceCapFlags {
951 fn default() -> Self {
952 Self::DEFAULT
953 }
954}
955bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal device (low level) error flags (bitmap, 0 means no error)"] pub struct GimbalDeviceErrorFlags : u32 { # [doc = "Gimbal device is limited by hardware roll limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_ROLL_LIMIT = 1 ; # [doc = "Gimbal device is limited by hardware pitch limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_PITCH_LIMIT = 2 ; # [doc = "Gimbal device is limited by hardware yaw limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_YAW_LIMIT = 4 ; # [doc = "There is an error with the gimbal encoders."] const GIMBAL_DEVICE_ERROR_FLAGS_ENCODER_ERROR = 8 ; # [doc = "There is an error with the gimbal power source."] const GIMBAL_DEVICE_ERROR_FLAGS_POWER_ERROR = 16 ; # [doc = "There is an error with the gimbal motors."] const GIMBAL_DEVICE_ERROR_FLAGS_MOTOR_ERROR = 32 ; # [doc = "There is an error with the gimbal's software."] const GIMBAL_DEVICE_ERROR_FLAGS_SOFTWARE_ERROR = 64 ; # [doc = "There is an error with the gimbal's communication."] const GIMBAL_DEVICE_ERROR_FLAGS_COMMS_ERROR = 128 ; # [doc = "Gimbal device is currently calibrating."] const GIMBAL_DEVICE_ERROR_FLAGS_CALIBRATION_RUNNING = 256 ; # [doc = "Gimbal device is not assigned to a gimbal manager."] const GIMBAL_DEVICE_ERROR_FLAGS_NO_MANAGER = 512 ; } }
956impl GimbalDeviceErrorFlags {
957 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_ERROR_FLAGS_AT_ROLL_LIMIT;
958}
959impl Default for GimbalDeviceErrorFlags {
960 fn default() -> Self {
961 Self::DEFAULT
962 }
963}
964bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for gimbal device (lower level) operation."] pub struct GimbalDeviceFlags : u16 { # [doc = "Set to retracted safe position (no stabilization), takes precedence over all other flags."] const GIMBAL_DEVICE_FLAGS_RETRACT = 1 ; # [doc = "Set to neutral/default position, taking precedence over all other flags except RETRACT. Neutral is commonly forward-facing and horizontal (roll=pitch=yaw=0) but may be any orientation."] const GIMBAL_DEVICE_FLAGS_NEUTRAL = 2 ; # [doc = "Lock roll angle to absolute angle relative to horizon (not relative to vehicle). This is generally the default with a stabilizing gimbal."] const GIMBAL_DEVICE_FLAGS_ROLL_LOCK = 4 ; # [doc = "Lock pitch angle to absolute angle relative to horizon (not relative to vehicle). This is generally the default with a stabilizing gimbal."] const GIMBAL_DEVICE_FLAGS_PITCH_LOCK = 8 ; # [doc = "Lock yaw angle to absolute angle relative to North (not relative to vehicle). If this flag is set, the yaw angle and z component of angular velocity are relative to North (earth frame, x-axis pointing North), else they are relative to the vehicle heading (vehicle frame, earth frame rotated so that the x-axis is pointing forward)."] const GIMBAL_DEVICE_FLAGS_YAW_LOCK = 16 ; # [doc = "Yaw angle and z component of angular velocity are relative to the vehicle heading (vehicle frame, earth frame rotated such that the x-axis is pointing forward)."] const GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME = 32 ; # [doc = "Yaw angle and z component of angular velocity are relative to North (earth frame, x-axis is pointing North)."] const GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME = 64 ; # [doc = "Gimbal device can accept yaw angle inputs relative to North (earth frame). This flag is only for reporting (attempts to set this flag are ignored)."] const GIMBAL_DEVICE_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME = 128 ; # [doc = "The gimbal orientation is set exclusively by the RC signals feed to the gimbal's radio control inputs. MAVLink messages for setting the gimbal orientation (GIMBAL_DEVICE_SET_ATTITUDE) are ignored."] const GIMBAL_DEVICE_FLAGS_RC_EXCLUSIVE = 256 ; # [doc = "The gimbal orientation is determined by combining/mixing the RC signals feed to the gimbal's radio control inputs and the MAVLink messages for setting the gimbal orientation (GIMBAL_DEVICE_SET_ATTITUDE). How these two controls are combined or mixed is not defined by the protocol but is up to the implementation."] const GIMBAL_DEVICE_FLAGS_RC_MIXED = 512 ; } }
965impl GimbalDeviceFlags {
966 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_FLAGS_RETRACT;
967}
968impl Default for GimbalDeviceFlags {
969 fn default() -> Self {
970 Self::DEFAULT
971 }
972}
973bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal manager high level capability flags (bitmap). The first 16 bits are identical to the GIMBAL_DEVICE_CAP_FLAGS. However, the gimbal manager does not need to copy the flags from the gimbal but can also enhance the capabilities and thus add flags."] pub struct GimbalManagerCapFlags : u32 { # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_RETRACT = 1 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_NEUTRAL."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_NEUTRAL = 2 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_AXIS = 4 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_FOLLOW = 8 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_LOCK = 16 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_AXIS = 32 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_FOLLOW = 64 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_LOCK = 128 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_AXIS = 256 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_FOLLOW = 512 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_LOCK = 1024 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_INFINITE_YAW."] const GIMBAL_MANAGER_CAP_FLAGS_SUPPORTS_INFINITE_YAW = 2048 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME = 4096 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_RC_INPUTS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_RC_INPUTS = 8192 ; # [doc = "Gimbal manager supports to point to a local position."] const GIMBAL_MANAGER_CAP_FLAGS_CAN_POINT_LOCATION_LOCAL = 65536 ; # [doc = "Gimbal manager supports to point to a global latitude, longitude, altitude position."] const GIMBAL_MANAGER_CAP_FLAGS_CAN_POINT_LOCATION_GLOBAL = 131072 ; } }
974impl GimbalManagerCapFlags {
975 pub const DEFAULT: Self = Self::GIMBAL_MANAGER_CAP_FLAGS_HAS_RETRACT;
976}
977impl Default for GimbalManagerCapFlags {
978 fn default() -> Self {
979 Self::DEFAULT
980 }
981}
982bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for high level gimbal manager operation The first 16 bits are identical to the GIMBAL_DEVICE_FLAGS."] pub struct GimbalManagerFlags : u32 { # [doc = "Based on GIMBAL_DEVICE_FLAGS_RETRACT."] const GIMBAL_MANAGER_FLAGS_RETRACT = 1 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_NEUTRAL."] const GIMBAL_MANAGER_FLAGS_NEUTRAL = 2 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_ROLL_LOCK."] const GIMBAL_MANAGER_FLAGS_ROLL_LOCK = 4 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_PITCH_LOCK."] const GIMBAL_MANAGER_FLAGS_PITCH_LOCK = 8 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_LOCK."] const GIMBAL_MANAGER_FLAGS_YAW_LOCK = 16 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME."] const GIMBAL_MANAGER_FLAGS_YAW_IN_VEHICLE_FRAME = 32 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_FLAGS_YAW_IN_EARTH_FRAME = 64 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME = 128 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_RC_EXCLUSIVE."] const GIMBAL_MANAGER_FLAGS_RC_EXCLUSIVE = 256 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_RC_MIXED."] const GIMBAL_MANAGER_FLAGS_RC_MIXED = 512 ; } }
983impl GimbalManagerFlags {
984 pub const DEFAULT: Self = Self::GIMBAL_MANAGER_FLAGS_RETRACT;
985}
986impl Default for GimbalManagerFlags {
987 fn default() -> Self {
988 Self::DEFAULT
989 }
990}
991#[cfg_attr(feature = "ts", derive(TS))]
992#[cfg_attr(feature = "ts", ts(export))]
993#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
994#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
995#[cfg_attr(feature = "serde", serde(tag = "type"))]
996#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
997#[repr(u32)]
998#[doc = "Type of GPS fix"]
999pub enum GpsFixType {
1000 #[doc = "No GPS connected"]
1001 GPS_FIX_TYPE_NO_GPS = 0,
1002 #[doc = "No position information, GPS is connected"]
1003 GPS_FIX_TYPE_NO_FIX = 1,
1004 #[doc = "2D position"]
1005 GPS_FIX_TYPE_2D_FIX = 2,
1006 #[doc = "3D position"]
1007 GPS_FIX_TYPE_3D_FIX = 3,
1008 #[doc = "DGPS/SBAS aided 3D position"]
1009 GPS_FIX_TYPE_DGPS = 4,
1010 #[doc = "RTK float, 3D position"]
1011 GPS_FIX_TYPE_RTK_FLOAT = 5,
1012 #[doc = "RTK Fixed, 3D position"]
1013 GPS_FIX_TYPE_RTK_FIXED = 6,
1014 #[doc = "Static fixed, typically used for base stations"]
1015 GPS_FIX_TYPE_STATIC = 7,
1016 #[doc = "PPP, 3D position."]
1017 GPS_FIX_TYPE_PPP = 8,
1018}
1019impl GpsFixType {
1020 pub const DEFAULT: Self = Self::GPS_FIX_TYPE_NO_GPS;
1021}
1022impl Default for GpsFixType {
1023 fn default() -> Self {
1024 Self::DEFAULT
1025 }
1026}
1027bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] pub struct GpsInputIgnoreFlags : u16 { # [doc = "ignore altitude field"] const GPS_INPUT_IGNORE_FLAG_ALT = 1 ; # [doc = "ignore hdop field"] const GPS_INPUT_IGNORE_FLAG_HDOP = 2 ; # [doc = "ignore vdop field"] const GPS_INPUT_IGNORE_FLAG_VDOP = 4 ; # [doc = "ignore horizontal velocity field (vn and ve)"] const GPS_INPUT_IGNORE_FLAG_VEL_HORIZ = 8 ; # [doc = "ignore vertical velocity field (vd)"] const GPS_INPUT_IGNORE_FLAG_VEL_VERT = 16 ; # [doc = "ignore speed accuracy field"] const GPS_INPUT_IGNORE_FLAG_SPEED_ACCURACY = 32 ; # [doc = "ignore horizontal accuracy field"] const GPS_INPUT_IGNORE_FLAG_HORIZONTAL_ACCURACY = 64 ; # [doc = "ignore vertical accuracy field"] const GPS_INPUT_IGNORE_FLAG_VERTICAL_ACCURACY = 128 ; } }
1028impl GpsInputIgnoreFlags {
1029 pub const DEFAULT: Self = Self::GPS_INPUT_IGNORE_FLAG_ALT;
1030}
1031impl Default for GpsInputIgnoreFlags {
1032 fn default() -> Self {
1033 Self::DEFAULT
1034 }
1035}
1036#[cfg_attr(feature = "ts", derive(TS))]
1037#[cfg_attr(feature = "ts", ts(export))]
1038#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1039#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1040#[cfg_attr(feature = "serde", serde(tag = "type"))]
1041#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1042#[repr(u32)]
1043#[doc = "Gripper actions."]
1044pub enum GripperActions {
1045 #[doc = "Gripper release cargo."]
1046 GRIPPER_ACTION_RELEASE = 0,
1047 #[doc = "Gripper grab onto cargo."]
1048 GRIPPER_ACTION_GRAB = 1,
1049}
1050impl GripperActions {
1051 pub const DEFAULT: Self = Self::GRIPPER_ACTION_RELEASE;
1052}
1053impl Default for GripperActions {
1054 fn default() -> Self {
1055 Self::DEFAULT
1056 }
1057}
1058bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in the HIGHRES_IMU message indicate which fields have updated since the last message"] pub struct HighresImuUpdatedFlags : u16 { # [doc = "The value in the xacc field has been updated"] const HIGHRES_IMU_UPDATED_XACC = 1 ; # [doc = "The value in the yacc field has been updated"] const HIGHRES_IMU_UPDATED_YACC = 2 ; # [doc = "The value in the zacc field has been updated since"] const HIGHRES_IMU_UPDATED_ZACC = 4 ; # [doc = "The value in the xgyro field has been updated"] const HIGHRES_IMU_UPDATED_XGYRO = 8 ; # [doc = "The value in the ygyro field has been updated"] const HIGHRES_IMU_UPDATED_YGYRO = 16 ; # [doc = "The value in the zgyro field has been updated"] const HIGHRES_IMU_UPDATED_ZGYRO = 32 ; # [doc = "The value in the xmag field has been updated"] const HIGHRES_IMU_UPDATED_XMAG = 64 ; # [doc = "The value in the ymag field has been updated"] const HIGHRES_IMU_UPDATED_YMAG = 128 ; # [doc = "The value in the zmag field has been updated"] const HIGHRES_IMU_UPDATED_ZMAG = 256 ; # [doc = "The value in the abs_pressure field has been updated"] const HIGHRES_IMU_UPDATED_ABS_PRESSURE = 512 ; # [doc = "The value in the diff_pressure field has been updated"] const HIGHRES_IMU_UPDATED_DIFF_PRESSURE = 1024 ; # [doc = "The value in the pressure_alt field has been updated"] const HIGHRES_IMU_UPDATED_PRESSURE_ALT = 2048 ; # [doc = "The value in the temperature field has been updated"] const HIGHRES_IMU_UPDATED_TEMPERATURE = 4096 ; } }
1059impl HighresImuUpdatedFlags {
1060 pub const DEFAULT: Self = Self::HIGHRES_IMU_UPDATED_XACC;
1061}
1062impl Default for HighresImuUpdatedFlags {
1063 fn default() -> Self {
1064 Self::DEFAULT
1065 }
1066}
1067bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags used in HIL_ACTUATOR_CONTROLS message."] pub struct HilActuatorControlsFlags : u64 { # [doc = "Simulation is using lockstep"] const HIL_ACTUATOR_CONTROLS_FLAGS_LOCKSTEP = 1 ; } }
1068impl HilActuatorControlsFlags {
1069 pub const DEFAULT: Self = Self::HIL_ACTUATOR_CONTROLS_FLAGS_LOCKSTEP;
1070}
1071impl Default for HilActuatorControlsFlags {
1072 fn default() -> Self {
1073 Self::DEFAULT
1074 }
1075}
1076bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in the HIL_SENSOR message indicate which fields have updated since the last message"] pub struct HilSensorUpdatedFlags : u32 { # [doc = "The value in the xacc field has been updated"] const HIL_SENSOR_UPDATED_XACC = 1 ; # [doc = "The value in the yacc field has been updated"] const HIL_SENSOR_UPDATED_YACC = 2 ; # [doc = "The value in the zacc field has been updated"] const HIL_SENSOR_UPDATED_ZACC = 4 ; # [doc = "The value in the xgyro field has been updated"] const HIL_SENSOR_UPDATED_XGYRO = 8 ; # [doc = "The value in the ygyro field has been updated"] const HIL_SENSOR_UPDATED_YGYRO = 16 ; # [doc = "The value in the zgyro field has been updated"] const HIL_SENSOR_UPDATED_ZGYRO = 32 ; # [doc = "The value in the xmag field has been updated"] const HIL_SENSOR_UPDATED_XMAG = 64 ; # [doc = "The value in the ymag field has been updated"] const HIL_SENSOR_UPDATED_YMAG = 128 ; # [doc = "The value in the zmag field has been updated"] const HIL_SENSOR_UPDATED_ZMAG = 256 ; # [doc = "The value in the abs_pressure field has been updated"] const HIL_SENSOR_UPDATED_ABS_PRESSURE = 512 ; # [doc = "The value in the diff_pressure field has been updated"] const HIL_SENSOR_UPDATED_DIFF_PRESSURE = 1024 ; # [doc = "The value in the pressure_alt field has been updated"] const HIL_SENSOR_UPDATED_PRESSURE_ALT = 2048 ; # [doc = "The value in the temperature field has been updated"] const HIL_SENSOR_UPDATED_TEMPERATURE = 4096 ; # [doc = "Full reset of attitude/position/velocities/etc was performed in sim (Bit 31)."] const HIL_SENSOR_UPDATED_RESET = 2147483648 ; } }
1077impl HilSensorUpdatedFlags {
1078 pub const DEFAULT: Self = Self::HIL_SENSOR_UPDATED_XACC;
1079}
1080impl Default for HilSensorUpdatedFlags {
1081 fn default() -> Self {
1082 Self::DEFAULT
1083 }
1084}
1085bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report failure cases over the high latency telemetry."] pub struct HlFailureFlag : u16 { # [doc = "GPS failure."] const HL_FAILURE_FLAG_GPS = 1 ; # [doc = "Differential pressure sensor failure."] const HL_FAILURE_FLAG_DIFFERENTIAL_PRESSURE = 2 ; # [doc = "Absolute pressure sensor failure."] const HL_FAILURE_FLAG_ABSOLUTE_PRESSURE = 4 ; # [doc = "Accelerometer sensor failure."] const HL_FAILURE_FLAG_3D_ACCEL = 8 ; # [doc = "Gyroscope sensor failure."] const HL_FAILURE_FLAG_3D_GYRO = 16 ; # [doc = "Magnetometer sensor failure."] const HL_FAILURE_FLAG_3D_MAG = 32 ; # [doc = "Terrain subsystem failure."] const HL_FAILURE_FLAG_TERRAIN = 64 ; # [doc = "Battery failure/critical low battery."] const HL_FAILURE_FLAG_BATTERY = 128 ; # [doc = "RC receiver failure/no RC connection."] const HL_FAILURE_FLAG_RC_RECEIVER = 256 ; # [doc = "Offboard link failure."] const HL_FAILURE_FLAG_OFFBOARD_LINK = 512 ; # [doc = "Engine failure."] const HL_FAILURE_FLAG_ENGINE = 1024 ; # [doc = "Geofence violation."] const HL_FAILURE_FLAG_GEOFENCE = 2048 ; # [doc = "Estimator failure, for example measurement rejection or large variances."] const HL_FAILURE_FLAG_ESTIMATOR = 4096 ; # [doc = "Mission failure."] const HL_FAILURE_FLAG_MISSION = 8192 ; } }
1086impl HlFailureFlag {
1087 pub const DEFAULT: Self = Self::HL_FAILURE_FLAG_GPS;
1088}
1089impl Default for HlFailureFlag {
1090 fn default() -> Self {
1091 Self::DEFAULT
1092 }
1093}
1094bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Illuminator module error flags (bitmap, 0 means no error)"] pub struct IlluminatorErrorFlags : u32 { # [doc = "Illuminator thermal throttling error."] const ILLUMINATOR_ERROR_FLAGS_THERMAL_THROTTLING = 1 ; # [doc = "Illuminator over temperature shutdown error."] const ILLUMINATOR_ERROR_FLAGS_OVER_TEMPERATURE_SHUTDOWN = 2 ; # [doc = "Illuminator thermistor failure."] const ILLUMINATOR_ERROR_FLAGS_THERMISTOR_FAILURE = 4 ; } }
1095impl IlluminatorErrorFlags {
1096 pub const DEFAULT: Self = Self::ILLUMINATOR_ERROR_FLAGS_THERMAL_THROTTLING;
1097}
1098impl Default for IlluminatorErrorFlags {
1099 fn default() -> Self {
1100 Self::DEFAULT
1101 }
1102}
1103#[cfg_attr(feature = "ts", derive(TS))]
1104#[cfg_attr(feature = "ts", ts(export))]
1105#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1106#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1107#[cfg_attr(feature = "serde", serde(tag = "type"))]
1108#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1109#[repr(u32)]
1110#[doc = "Modes of illuminator"]
1111pub enum IlluminatorMode {
1112 #[doc = "Illuminator mode is not specified/unknown"]
1113 ILLUMINATOR_MODE_UNKNOWN = 0,
1114 #[doc = "Illuminator behavior is controlled by MAV_CMD_DO_ILLUMINATOR_CONFIGURE settings"]
1115 ILLUMINATOR_MODE_INTERNAL_CONTROL = 1,
1116 #[doc = "Illuminator behavior is controlled by external factors: e.g. an external hardware signal"]
1117 ILLUMINATOR_MODE_EXTERNAL_SYNC = 2,
1118}
1119impl IlluminatorMode {
1120 pub const DEFAULT: Self = Self::ILLUMINATOR_MODE_UNKNOWN;
1121}
1122impl Default for IlluminatorMode {
1123 fn default() -> Self {
1124 Self::DEFAULT
1125 }
1126}
1127#[cfg_attr(feature = "ts", derive(TS))]
1128#[cfg_attr(feature = "ts", ts(export))]
1129#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1130#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1131#[cfg_attr(feature = "serde", serde(tag = "type"))]
1132#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1133#[repr(u32)]
1134#[doc = "Type of landing target"]
1135pub enum LandingTargetType {
1136 #[doc = "Landing target signaled by light beacon (ex: IR-LOCK)"]
1137 LANDING_TARGET_TYPE_LIGHT_BEACON = 0,
1138 #[doc = "Landing target signaled by radio beacon (ex: ILS, NDB)"]
1139 LANDING_TARGET_TYPE_RADIO_BEACON = 1,
1140 #[doc = "Landing target represented by a fiducial marker (ex: ARTag)"]
1141 LANDING_TARGET_TYPE_VISION_FIDUCIAL = 2,
1142 #[doc = "Landing target represented by a pre-defined visual shape/feature (ex: X-marker, H-marker, square)"]
1143 LANDING_TARGET_TYPE_VISION_OTHER = 3,
1144}
1145impl LandingTargetType {
1146 pub const DEFAULT: Self = Self::LANDING_TARGET_TYPE_LIGHT_BEACON;
1147}
1148impl Default for LandingTargetType {
1149 fn default() -> Self {
1150 Self::DEFAULT
1151 }
1152}
1153#[cfg_attr(feature = "ts", derive(TS))]
1154#[cfg_attr(feature = "ts", ts(export))]
1155#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1156#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1157#[cfg_attr(feature = "serde", serde(tag = "type"))]
1158#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1159#[repr(u32)]
1160pub enum MagCalStatus {
1161 MAG_CAL_NOT_STARTED = 0,
1162 MAG_CAL_WAITING_TO_START = 1,
1163 MAG_CAL_RUNNING_STEP_ONE = 2,
1164 MAG_CAL_RUNNING_STEP_TWO = 3,
1165 MAG_CAL_SUCCESS = 4,
1166 MAG_CAL_FAILED = 5,
1167 MAG_CAL_BAD_ORIENTATION = 6,
1168 MAG_CAL_BAD_RADIUS = 7,
1169}
1170impl MagCalStatus {
1171 pub const DEFAULT: Self = Self::MAG_CAL_NOT_STARTED;
1172}
1173impl Default for MagCalStatus {
1174 fn default() -> Self {
1175 Self::DEFAULT
1176 }
1177}
1178#[cfg_attr(feature = "ts", derive(TS))]
1179#[cfg_attr(feature = "ts", ts(export))]
1180#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1181#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1182#[cfg_attr(feature = "serde", serde(tag = "type"))]
1183#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1184#[repr(u32)]
1185pub enum MavArmAuthDeniedReason {
1186 #[doc = "Not a specific reason"]
1187 MAV_ARM_AUTH_DENIED_REASON_GENERIC = 0,
1188 #[doc = "Authorizer will send the error as string to GCS"]
1189 MAV_ARM_AUTH_DENIED_REASON_NONE = 1,
1190 #[doc = "At least one waypoint have a invalid value"]
1191 MAV_ARM_AUTH_DENIED_REASON_INVALID_WAYPOINT = 2,
1192 #[doc = "Timeout in the authorizer process(in case it depends on network)"]
1193 MAV_ARM_AUTH_DENIED_REASON_TIMEOUT = 3,
1194 #[doc = "Airspace of the mission in use by another vehicle, second result parameter can have the waypoint id that caused it to be denied."]
1195 MAV_ARM_AUTH_DENIED_REASON_AIRSPACE_IN_USE = 4,
1196 #[doc = "Weather is not good to fly"]
1197 MAV_ARM_AUTH_DENIED_REASON_BAD_WEATHER = 5,
1198}
1199impl MavArmAuthDeniedReason {
1200 pub const DEFAULT: Self = Self::MAV_ARM_AUTH_DENIED_REASON_GENERIC;
1201}
1202impl Default for MavArmAuthDeniedReason {
1203 fn default() -> Self {
1204 Self::DEFAULT
1205 }
1206}
1207#[cfg_attr(feature = "ts", derive(TS))]
1208#[cfg_attr(feature = "ts", ts(export))]
1209#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1210#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1211#[cfg_attr(feature = "serde", serde(tag = "type"))]
1212#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1213#[repr(u32)]
1214#[doc = "Micro air vehicle / autopilot classes. This identifies the individual model."]
1215pub enum MavAutopilot {
1216 #[doc = "Generic autopilot, full support for everything"]
1217 MAV_AUTOPILOT_GENERIC = 0,
1218 #[doc = "Reserved for future use."]
1219 MAV_AUTOPILOT_RESERVED = 1,
1220 #[doc = "SLUGS autopilot, <http://slugsuav.soe.ucsc.edu>"]
1221 MAV_AUTOPILOT_SLUGS = 2,
1222 #[doc = "ArduPilot - Plane/Copter/Rover/Sub/Tracker, <https://ardupilot.org>"]
1223 MAV_AUTOPILOT_ARDUPILOTMEGA = 3,
1224 #[doc = "OpenPilot, <http://openpilot.org>"]
1225 MAV_AUTOPILOT_OPENPILOT = 4,
1226 #[doc = "Generic autopilot only supporting simple waypoints"]
1227 MAV_AUTOPILOT_GENERIC_WAYPOINTS_ONLY = 5,
1228 #[doc = "Generic autopilot supporting waypoints and other simple navigation commands"]
1229 MAV_AUTOPILOT_GENERIC_WAYPOINTS_AND_SIMPLE_NAVIGATION_ONLY = 6,
1230 #[doc = "Generic autopilot supporting the full mission command set"]
1231 MAV_AUTOPILOT_GENERIC_MISSION_FULL = 7,
1232 #[doc = "No valid autopilot, e.g. a GCS or other MAVLink component"]
1233 MAV_AUTOPILOT_INVALID = 8,
1234 #[doc = "PPZ UAV - <http://nongnu.org/paparazzi>"]
1235 MAV_AUTOPILOT_PPZ = 9,
1236 #[doc = "UAV Dev Board"]
1237 MAV_AUTOPILOT_UDB = 10,
1238 #[doc = "FlexiPilot"]
1239 MAV_AUTOPILOT_FP = 11,
1240 #[doc = "PX4 Autopilot - <http://px4.io/>"]
1241 MAV_AUTOPILOT_PX4 = 12,
1242 #[doc = "SMACCMPilot - <http://smaccmpilot.org>"]
1243 MAV_AUTOPILOT_SMACCMPILOT = 13,
1244 #[doc = "AutoQuad -- <http://autoquad.org>"]
1245 MAV_AUTOPILOT_AUTOQUAD = 14,
1246 #[doc = "Armazila -- <http://armazila.com>"]
1247 MAV_AUTOPILOT_ARMAZILA = 15,
1248 #[doc = "Aerob -- <http://aerob.ru>"]
1249 MAV_AUTOPILOT_AEROB = 16,
1250 #[doc = "ASLUAV autopilot -- <http://www.asl.ethz.ch>"]
1251 MAV_AUTOPILOT_ASLUAV = 17,
1252 #[doc = "SmartAP Autopilot - <http://sky-drones.com>"]
1253 MAV_AUTOPILOT_SMARTAP = 18,
1254 #[doc = "AirRails - <http://uaventure.com>"]
1255 MAV_AUTOPILOT_AIRRAILS = 19,
1256 #[doc = "Fusion Reflex - <https://fusion.engineering>"]
1257 MAV_AUTOPILOT_REFLEX = 20,
1258}
1259impl MavAutopilot {
1260 pub const DEFAULT: Self = Self::MAV_AUTOPILOT_GENERIC;
1261}
1262impl Default for MavAutopilot {
1263 fn default() -> Self {
1264 Self::DEFAULT
1265 }
1266}
1267#[cfg_attr(feature = "ts", derive(TS))]
1268#[cfg_attr(feature = "ts", ts(export))]
1269#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1270#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1271#[cfg_attr(feature = "serde", serde(tag = "type"))]
1272#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1273#[repr(u32)]
1274#[doc = "Enumeration for battery charge states."]
1275pub enum MavBatteryChargeState {
1276 #[doc = "Low battery state is not provided"]
1277 MAV_BATTERY_CHARGE_STATE_UNDEFINED = 0,
1278 #[doc = "Battery is not in low state. Normal operation."]
1279 MAV_BATTERY_CHARGE_STATE_OK = 1,
1280 #[doc = "Battery state is low, warn and monitor close."]
1281 MAV_BATTERY_CHARGE_STATE_LOW = 2,
1282 #[doc = "Battery state is critical, return or abort immediately."]
1283 MAV_BATTERY_CHARGE_STATE_CRITICAL = 3,
1284 #[doc = "Battery state is too low for ordinary abort sequence. Perform fastest possible emergency stop to prevent damage."]
1285 MAV_BATTERY_CHARGE_STATE_EMERGENCY = 4,
1286 #[doc = "Battery failed, damage unavoidable. Possible causes (faults) are listed in MAV_BATTERY_FAULT."]
1287 MAV_BATTERY_CHARGE_STATE_FAILED = 5,
1288 #[doc = "Battery is diagnosed to be defective or an error occurred, usage is discouraged / prohibited. Possible causes (faults) are listed in MAV_BATTERY_FAULT."]
1289 MAV_BATTERY_CHARGE_STATE_UNHEALTHY = 6,
1290 #[doc = "Battery is charging."]
1291 MAV_BATTERY_CHARGE_STATE_CHARGING = 7,
1292}
1293impl MavBatteryChargeState {
1294 pub const DEFAULT: Self = Self::MAV_BATTERY_CHARGE_STATE_UNDEFINED;
1295}
1296impl Default for MavBatteryChargeState {
1297 fn default() -> Self {
1298 Self::DEFAULT
1299 }
1300}
1301bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Smart battery supply status/fault flags (bitmask) for health indication. The battery must also report either MAV_BATTERY_CHARGE_STATE_FAILED or MAV_BATTERY_CHARGE_STATE_UNHEALTHY if any of these are set."] pub struct MavBatteryFault : u32 { # [doc = "Battery has deep discharged."] const MAV_BATTERY_FAULT_DEEP_DISCHARGE = 1 ; # [doc = "Voltage spikes."] const MAV_BATTERY_FAULT_SPIKES = 2 ; # [doc = "One or more cells have failed. Battery should also report MAV_BATTERY_CHARGE_STATE_FAILE (and should not be used)."] const MAV_BATTERY_FAULT_CELL_FAIL = 4 ; # [doc = "Over-current fault."] const MAV_BATTERY_FAULT_OVER_CURRENT = 8 ; # [doc = "Over-temperature fault."] const MAV_BATTERY_FAULT_OVER_TEMPERATURE = 16 ; # [doc = "Under-temperature fault."] const MAV_BATTERY_FAULT_UNDER_TEMPERATURE = 32 ; # [doc = "Vehicle voltage is not compatible with this battery (batteries on same power rail should have similar voltage)."] const MAV_BATTERY_FAULT_INCOMPATIBLE_VOLTAGE = 64 ; # [doc = "Battery firmware is not compatible with current autopilot firmware."] const MAV_BATTERY_FAULT_INCOMPATIBLE_FIRMWARE = 128 ; # [doc = "Battery is not compatible due to cell configuration (e.g. 5s1p when vehicle requires 6s)."] const BATTERY_FAULT_INCOMPATIBLE_CELLS_CONFIGURATION = 256 ; } }
1302impl MavBatteryFault {
1303 pub const DEFAULT: Self = Self::MAV_BATTERY_FAULT_DEEP_DISCHARGE;
1304}
1305impl Default for MavBatteryFault {
1306 fn default() -> Self {
1307 Self::DEFAULT
1308 }
1309}
1310#[cfg_attr(feature = "ts", derive(TS))]
1311#[cfg_attr(feature = "ts", ts(export))]
1312#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1313#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1314#[cfg_attr(feature = "serde", serde(tag = "type"))]
1315#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1316#[repr(u32)]
1317#[doc = "Enumeration of battery functions"]
1318pub enum MavBatteryFunction {
1319 #[doc = "Battery function is unknown"]
1320 MAV_BATTERY_FUNCTION_UNKNOWN = 0,
1321 #[doc = "Battery supports all flight systems"]
1322 MAV_BATTERY_FUNCTION_ALL = 1,
1323 #[doc = "Battery for the propulsion system"]
1324 MAV_BATTERY_FUNCTION_PROPULSION = 2,
1325 #[doc = "Avionics battery"]
1326 MAV_BATTERY_FUNCTION_AVIONICS = 3,
1327 #[doc = "Payload battery"]
1328 MAV_BATTERY_FUNCTION_PAYLOAD = 4,
1329}
1330impl MavBatteryFunction {
1331 pub const DEFAULT: Self = Self::MAV_BATTERY_FUNCTION_UNKNOWN;
1332}
1333impl Default for MavBatteryFunction {
1334 fn default() -> Self {
1335 Self::DEFAULT
1336 }
1337}
1338#[cfg_attr(feature = "ts", derive(TS))]
1339#[cfg_attr(feature = "ts", ts(export))]
1340#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1341#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1342#[cfg_attr(feature = "serde", serde(tag = "type"))]
1343#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1344#[repr(u32)]
1345#[doc = "Battery mode. Note, the normal operation mode (i.e. when flying) should be reported as MAV_BATTERY_MODE_UNKNOWN to allow message trimming in normal flight."]
1346pub enum MavBatteryMode {
1347 #[doc = "Battery mode not supported/unknown battery mode/normal operation."]
1348 MAV_BATTERY_MODE_UNKNOWN = 0,
1349 #[doc = "Battery is auto discharging (towards storage level)."]
1350 MAV_BATTERY_MODE_AUTO_DISCHARGING = 1,
1351 #[doc = "Battery in hot-swap mode (current limited to prevent spikes that might damage sensitive electrical circuits)."]
1352 MAV_BATTERY_MODE_HOT_SWAP = 2,
1353}
1354impl MavBatteryMode {
1355 pub const DEFAULT: Self = Self::MAV_BATTERY_MODE_UNKNOWN;
1356}
1357impl Default for MavBatteryMode {
1358 fn default() -> Self {
1359 Self::DEFAULT
1360 }
1361}
1362#[cfg_attr(feature = "ts", derive(TS))]
1363#[cfg_attr(feature = "ts", ts(export))]
1364#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1365#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1366#[cfg_attr(feature = "serde", serde(tag = "type"))]
1367#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1368#[repr(u32)]
1369#[doc = "Enumeration of battery types"]
1370pub enum MavBatteryType {
1371 #[doc = "Not specified."]
1372 MAV_BATTERY_TYPE_UNKNOWN = 0,
1373 #[doc = "Lithium polymer battery"]
1374 MAV_BATTERY_TYPE_LIPO = 1,
1375 #[doc = "Lithium-iron-phosphate battery"]
1376 MAV_BATTERY_TYPE_LIFE = 2,
1377 #[doc = "Lithium-ION battery"]
1378 MAV_BATTERY_TYPE_LION = 3,
1379 #[doc = "Nickel metal hydride battery"]
1380 MAV_BATTERY_TYPE_NIMH = 4,
1381}
1382impl MavBatteryType {
1383 pub const DEFAULT: Self = Self::MAV_BATTERY_TYPE_UNKNOWN;
1384}
1385impl Default for MavBatteryType {
1386 fn default() -> Self {
1387 Self::DEFAULT
1388 }
1389}
1390#[cfg_attr(feature = "ts", derive(TS))]
1391#[cfg_attr(feature = "ts", ts(export))]
1392#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1393#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1394#[cfg_attr(feature = "serde", serde(tag = "type"))]
1395#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1396#[repr(u32)]
1397#[doc = "Commands to be executed by the MAV. They can be executed on user request, or as part of a mission script. If the action is used in a mission, the parameter mapping to the waypoint/mission message is as follows: Param 1, Param 2, Param 3, Param 4, X: Param 5, Y:Param 6, Z:Param 7. This command list is similar what ARINC 424 is for commercial aircraft: A data format how to interpret waypoint/mission data. NaN and INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current yaw or latitude rather than a specific value). See <https://mavlink.io/en/guide/xml_schema.html#MAV_CMD> for information about the structure of the MAV_CMD entries"]
1398pub enum MavCmd {
1399 #[doc = "Navigate to waypoint. This is intended for use in missions (for guided commands outside of missions use MAV_CMD_DO_REPOSITION)."]
1400 MAV_CMD_NAV_WAYPOINT = 16,
1401 #[doc = "Loiter around this waypoint an unlimited amount of time"]
1402 MAV_CMD_NAV_LOITER_UNLIM = 17,
1403 #[doc = "Loiter around this waypoint for X turns"]
1404 MAV_CMD_NAV_LOITER_TURNS = 18,
1405 #[doc = "Loiter at the specified latitude, longitude and altitude for a certain amount of time. Multicopter vehicles stop at the point (within a vehicle-specific acceptance radius). Forward-only moving vehicles (e.g. fixed-wing) circle the point with the specified radius/direction. If the Heading Required parameter (2) is non-zero forward moving aircraft will only leave the loiter circle once heading towards the next waypoint."]
1406 MAV_CMD_NAV_LOITER_TIME = 19,
1407 #[doc = "Return to launch location"]
1408 MAV_CMD_NAV_RETURN_TO_LAUNCH = 20,
1409 #[doc = "Land at location."]
1410 MAV_CMD_NAV_LAND = 21,
1411 #[doc = "Takeoff from ground / hand. Vehicles that support multiple takeoff modes (e.g. VTOL quadplane) should take off using the currently configured mode."]
1412 MAV_CMD_NAV_TAKEOFF = 22,
1413 #[doc = "Land at local position (local frame only)"]
1414 MAV_CMD_NAV_LAND_LOCAL = 23,
1415 #[doc = "Takeoff from local position (local frame only)"]
1416 MAV_CMD_NAV_TAKEOFF_LOCAL = 24,
1417 #[doc = "Vehicle following, i.e. this waypoint represents the position of a moving vehicle"]
1418 MAV_CMD_NAV_FOLLOW = 25,
1419 #[doc = "Continue on the current course and climb/descend to specified altitude. When the altitude is reached continue to the next command (i.e., don't proceed to the next command until the desired altitude is reached."]
1420 MAV_CMD_NAV_CONTINUE_AND_CHANGE_ALT = 30,
1421 #[doc = "Begin loiter at the specified Latitude and Longitude. If Lat=Lon=0, then loiter at the current position. Don't consider the navigation command complete (don't leave loiter) until the altitude has been reached. Additionally, if the Heading Required parameter is non-zero the aircraft will not leave the loiter until heading toward the next waypoint."]
1422 MAV_CMD_NAV_LOITER_TO_ALT = 31,
1423 #[doc = "Begin following a target"]
1424 MAV_CMD_DO_FOLLOW = 32,
1425 #[doc = "Reposition the MAV after a follow target command has been sent"]
1426 MAV_CMD_DO_FOLLOW_REPOSITION = 33,
1427 #[doc = "Start orbiting on the circumference of a circle defined by the parameters. Setting values to NaN/INT32_MAX (as appropriate) results in using defaults."]
1428 MAV_CMD_DO_ORBIT = 34,
1429 #[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
1430 #[doc = "Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras."]
1431 MAV_CMD_NAV_ROI = 80,
1432 #[doc = "Control autonomous path planning on the MAV."]
1433 MAV_CMD_NAV_PATHPLANNING = 81,
1434 #[doc = "Navigate to waypoint using a spline path."]
1435 MAV_CMD_NAV_SPLINE_WAYPOINT = 82,
1436 #[doc = "Takeoff from ground using VTOL mode, and transition to forward flight with specified heading. The command should be ignored by vehicles that dont support both VTOL and fixed-wing flight (multicopters, boats,etc.)."]
1437 MAV_CMD_NAV_VTOL_TAKEOFF = 84,
1438 #[doc = "Land using VTOL mode"]
1439 MAV_CMD_NAV_VTOL_LAND = 85,
1440 #[doc = "hand control over to an external controller"]
1441 MAV_CMD_NAV_GUIDED_ENABLE = 92,
1442 #[doc = "Delay the next navigation command a number of seconds or until a specified time"]
1443 MAV_CMD_NAV_DELAY = 93,
1444 #[doc = "Descend and place payload. Vehicle moves to specified location, descends until it detects a hanging payload has reached the ground, and then releases the payload. If ground is not detected before the reaching the maximum descent value (param1), the command will complete without releasing the payload."]
1445 MAV_CMD_NAV_PAYLOAD_PLACE = 94,
1446 #[doc = "NOP - This command is only used to mark the upper limit of the NAV/ACTION commands in the enumeration"]
1447 MAV_CMD_NAV_LAST = 95,
1448 #[doc = "Delay mission state machine."]
1449 MAV_CMD_CONDITION_DELAY = 112,
1450 #[doc = "Ascend/descend to target altitude at specified rate. Delay mission state machine until desired altitude reached."]
1451 MAV_CMD_CONDITION_CHANGE_ALT = 113,
1452 #[doc = "Delay mission state machine until within desired distance of next NAV point."]
1453 MAV_CMD_CONDITION_DISTANCE = 114,
1454 #[doc = "Reach a certain target angle."]
1455 MAV_CMD_CONDITION_YAW = 115,
1456 #[doc = "NOP - This command is only used to mark the upper limit of the CONDITION commands in the enumeration"]
1457 MAV_CMD_CONDITION_LAST = 159,
1458 #[doc = "Set system mode."]
1459 MAV_CMD_DO_SET_MODE = 176,
1460 #[doc = "Jump to the desired command in the mission list. Repeat this action only the specified number of times"]
1461 MAV_CMD_DO_JUMP = 177,
1462 #[doc = "Change speed and/or throttle set points. The value persists until it is overridden or there is a mode change"]
1463 MAV_CMD_DO_CHANGE_SPEED = 178,
1464 #[doc = "Sets the home position to either to the current position or a specified position. The home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this command). Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
1465 MAV_CMD_DO_SET_HOME = 179,
1466 #[deprecated = " See `PARAM_SET` (Deprecated since 2024-04)"]
1467 #[doc = "Set a system parameter. Caution! Use of this command requires knowledge of the numeric enumeration value of the parameter."]
1468 MAV_CMD_DO_SET_PARAMETER = 180,
1469 #[doc = "Set a relay to a condition."]
1470 MAV_CMD_DO_SET_RELAY = 181,
1471 #[doc = "Cycle a relay on and off for a desired number of cycles with a desired period."]
1472 MAV_CMD_DO_REPEAT_RELAY = 182,
1473 #[doc = "Set a servo to a desired PWM value."]
1474 MAV_CMD_DO_SET_SERVO = 183,
1475 #[doc = "Cycle a between its nominal setting and a desired PWM for a desired number of cycles with a desired period."]
1476 MAV_CMD_DO_REPEAT_SERVO = 184,
1477 #[doc = "0.5); the ACK should be either MAV_RESULT_FAILED or MAV_RESULT_UNSUPPORTED."]
1478 MAV_CMD_DO_FLIGHTTERMINATION = 185,
1479 #[doc = "Change altitude set point."]
1480 MAV_CMD_DO_CHANGE_ALTITUDE = 186,
1481 #[doc = "Sets actuators (e.g. servos) to a desired value. The actuator numbers are mapped to specific outputs (e.g. on any MAIN or AUX PWM or UAVCAN) using a flight-stack specific mechanism (i.e. a parameter)."]
1482 MAV_CMD_DO_SET_ACTUATOR = 187,
1483 #[doc = "Mission item to specify the start of a failsafe/landing return-path segment (the end of the segment is the next MAV_CMD_DO_LAND_START item). A vehicle that is using missions for landing (e.g. in a return mode) will join the mission on the closest path of the return-path segment (instead of MAV_CMD_DO_LAND_START or the nearest waypoint). The main use case is to minimize the failsafe flight path in corridor missions, where the inbound/outbound paths are constrained (by geofences) to the same particular path. The MAV_CMD_NAV_RETURN_PATH_START would be placed at the start of the return path. If a failsafe occurs on the outbound path the vehicle will move to the nearest point on the return path (which is parallel for this kind of mission), effectively turning round and following the shortest path to landing. If a failsafe occurs on the inbound path the vehicle is already on the return segment and will continue to landing. The Latitude/Longitude/Altitude are optional, and may be set to 0 if not needed. If specified, the item defines the waypoint at which the return segment starts. If sent using as a command, the vehicle will perform a mission landing (using the land segment if defined) or reject the command if mission landings are not supported, or no mission landing is defined. When used as a command any position information in the command is ignored."]
1484 MAV_CMD_DO_RETURN_PATH_START = 188,
1485 #[doc = "Mission item to mark the start of a mission landing pattern, or a command to land with a mission landing pattern. When used in a mission, this is a marker for the start of a sequence of mission items that represent a landing pattern. It should be followed by a navigation item that defines the first waypoint of the landing sequence. The start marker positional params are used only for selecting what landing pattern to use if several are defined in the mission (the selected pattern will be the one with the marker position that is closest to the vehicle when a landing is commanded). If the marker item position has zero-values for latitude, longitude, and altitude, then landing pattern selection is instead based on the position of the first waypoint in the landing sequence. \t When sent as a command it triggers a landing using a mission landing pattern. \t The location parameters are not used in this case, and should be set to 0."]
1486 MAV_CMD_DO_LAND_START = 189,
1487 #[doc = "Mission command to perform a landing from a rally point."]
1488 MAV_CMD_DO_RALLY_LAND = 190,
1489 #[doc = "Mission command to safely abort an autonomous landing."]
1490 MAV_CMD_DO_GO_AROUND = 191,
1491 #[doc = "Reposition the vehicle to a specific WGS84 global position. This command is intended for guided commands (for missions use MAV_CMD_NAV_WAYPOINT instead)."]
1492 MAV_CMD_DO_REPOSITION = 192,
1493 #[doc = "If in a GPS controlled position mode, hold the current position or continue."]
1494 MAV_CMD_DO_PAUSE_CONTINUE = 193,
1495 #[doc = "Set moving direction to forward or reverse."]
1496 MAV_CMD_DO_SET_REVERSE = 194,
1497 #[doc = "Sets the region of interest (ROI) to a location. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal is not to react to this message."]
1498 MAV_CMD_DO_SET_ROI_LOCATION = 195,
1499 #[doc = "Sets the region of interest (ROI) to be toward next waypoint, with optional pitch/roll/yaw offset. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message."]
1500 MAV_CMD_DO_SET_ROI_WPNEXT_OFFSET = 196,
1501 #[doc = "Cancels any previous ROI command returning the vehicle/sensors to default flight characteristics. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message. After this command the gimbal manager should go back to manual input if available, and otherwise assume a neutral position."]
1502 MAV_CMD_DO_SET_ROI_NONE = 197,
1503 #[doc = "Mount tracks system with specified system ID. Determination of target vehicle position may be done with GLOBAL_POSITION_INT or any other means. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message."]
1504 MAV_CMD_DO_SET_ROI_SYSID = 198,
1505 #[doc = "Control onboard camera system."]
1506 MAV_CMD_DO_CONTROL_VIDEO = 200,
1507 #[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
1508 #[doc = "Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras."]
1509 MAV_CMD_DO_SET_ROI = 201,
1510 #[doc = "Configure digital camera. This is a fallback message for systems that have not yet implemented PARAM_EXT_XXX messages and camera definition files (see <https://mavlink.io/en/services/camera_def.html> )."]
1511 MAV_CMD_DO_DIGICAM_CONFIGURE = 202,
1512 #[doc = "Control digital camera. This is a fallback message for systems that have not yet implemented PARAM_EXT_XXX messages and camera definition files (see <https://mavlink.io/en/services/camera_def.html> )."]
1513 MAV_CMD_DO_DIGICAM_CONTROL = 203,
1514 #[deprecated = "This message has been superseded by MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE` (Deprecated since 2020-01)"]
1515 #[doc = "Mission command to configure a camera or antenna mount"]
1516 MAV_CMD_DO_MOUNT_CONFIGURE = 204,
1517 #[deprecated = "This message is ambiguous and inconsistent. It has been superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW and `MAV_CMD_DO_SET_ROI_*` variants. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
1518 #[doc = "Mission command to control a camera or antenna mount"]
1519 MAV_CMD_DO_MOUNT_CONTROL = 205,
1520 #[doc = "Mission command to set camera trigger distance for this flight. The camera is triggered each time this distance is exceeded. This command can also be used to set the shutter integration time for the camera."]
1521 MAV_CMD_DO_SET_CAM_TRIGG_DIST = 206,
1522 #[doc = "Enable the geofence. This can be used in a mission or via the command protocol. The persistence/lifetime of the setting is undefined. Depending on flight stack implementation it may persist until superseded, or it may revert to a system default at the end of a mission. Flight stacks typically reset the setting to system defaults on reboot."]
1523 MAV_CMD_DO_FENCE_ENABLE = 207,
1524 #[doc = "Mission item/command to release a parachute or enable/disable auto release."]
1525 MAV_CMD_DO_PARACHUTE = 208,
1526 #[doc = "Command to perform motor test."]
1527 MAV_CMD_DO_MOTOR_TEST = 209,
1528 #[doc = "Change to/from inverted flight."]
1529 MAV_CMD_DO_INVERTED_FLIGHT = 210,
1530 #[doc = "Mission command to operate a gripper."]
1531 MAV_CMD_DO_GRIPPER = 211,
1532 #[doc = "Enable/disable autotune."]
1533 MAV_CMD_DO_AUTOTUNE_ENABLE = 212,
1534 #[doc = "Sets a desired vehicle turn angle and speed change."]
1535 MAV_CMD_NAV_SET_YAW_SPEED = 213,
1536 #[doc = "Mission command to set camera trigger interval for this flight. If triggering is enabled, the camera is triggered each time this interval expires. This command can also be used to set the shutter integration time for the camera."]
1537 MAV_CMD_DO_SET_CAM_TRIGG_INTERVAL = 214,
1538 #[deprecated = " See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
1539 #[doc = "Mission command to control a camera or antenna mount, using a quaternion as reference."]
1540 MAV_CMD_DO_MOUNT_CONTROL_QUAT = 220,
1541 #[doc = "set id of master controller"]
1542 MAV_CMD_DO_GUIDED_MASTER = 221,
1543 #[doc = "Set limits for external control"]
1544 MAV_CMD_DO_GUIDED_LIMITS = 222,
1545 #[doc = "Control vehicle engine. This is interpreted by the vehicles engine controller to change the target engine state. It is intended for vehicles with internal combustion engines"]
1546 MAV_CMD_DO_ENGINE_CONTROL = 223,
1547 #[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. \t Note that mission jump repeat counters are not reset unless param2 is set (see MAV_CMD_DO_JUMP param2). This command may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this command must not trigger a switch to mission mode. The mission may be \"reset\" using param2. Resetting sets jump counters to initial values (to reset counters without changing the current mission item set the param1 to `-1`). Resetting also explicitly changes a mission state of MISSION_STATE_COMPLETE to MISSION_STATE_PAUSED or MISSION_STATE_ACTIVE, potentially allowing it to resume when it is (next) in a mission mode. \t The command will ACK with MAV_RESULT_FAILED if the sequence number is out of range (including if there is no mission item)."]
1548 MAV_CMD_DO_SET_MISSION_CURRENT = 224,
1549 #[doc = "NOP - This command is only used to mark the upper limit of the DO commands in the enumeration"]
1550 MAV_CMD_DO_LAST = 240,
1551 #[doc = "Trigger calibration. This command will be only accepted if in pre-flight mode. Except for Temperature Calibration, only one sensor should be set in a single message and all others should be zero."]
1552 MAV_CMD_PREFLIGHT_CALIBRATION = 241,
1553 #[doc = "Set sensor offsets. This command will be only accepted if in pre-flight mode."]
1554 MAV_CMD_PREFLIGHT_SET_SENSOR_OFFSETS = 242,
1555 #[doc = "Trigger UAVCAN configuration (actuator ID assignment and direction mapping). Note that this maps to the legacy UAVCAN v0 function UAVCAN_ENUMERATE, which is intended to be executed just once during initial vehicle configuration (it is not a normal pre-flight command and has been poorly named)."]
1556 MAV_CMD_PREFLIGHT_UAVCAN = 243,
1557 #[doc = "Request storage of different parameter values and logs. This command will be only accepted if in pre-flight mode."]
1558 MAV_CMD_PREFLIGHT_STORAGE = 245,
1559 #[doc = "Request the reboot or shutdown of system components."]
1560 MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN = 246,
1561 #[doc = "Override current mission with command to pause mission, pause mission and move to position, continue/resume mission. When param 1 indicates that the mission is paused (MAV_GOTO_DO_HOLD), param 2 defines whether it holds in place or moves to another position."]
1562 MAV_CMD_OVERRIDE_GOTO = 252,
1563 #[doc = "Mission command to set a Camera Auto Mount Pivoting Oblique Survey (Replaces CAM_TRIGG_DIST for this purpose). The camera is triggered each time this distance is exceeded, then the mount moves to the next position. Params 4~6 set-up the angle limits and number of positions for oblique survey, where mount-enabled vehicles automatically roll the camera between shots to emulate an oblique camera setup (providing an increased HFOV). This command can also be used to set the shutter integration time for the camera."]
1564 MAV_CMD_OBLIQUE_SURVEY = 260,
1565 #[doc = "Enable the specified standard MAVLink mode. If the specified mode is not supported, the vehicle should ACK with MAV_RESULT_FAILED. See <https://mavlink.io/en/services/standard_modes.html>"]
1566 MAV_CMD_DO_SET_STANDARD_MODE = 262,
1567 #[doc = "start running a mission"]
1568 MAV_CMD_MISSION_START = 300,
1569 #[doc = "Actuator testing command. This is similar to MAV_CMD_DO_MOTOR_TEST but operates on the level of output functions, i.e. it is possible to test Motor1 independent from which output it is configured on. Autopilots must NACK this command with MAV_RESULT_TEMPORARILY_REJECTED while armed."]
1570 MAV_CMD_ACTUATOR_TEST = 310,
1571 #[doc = "Actuator configuration command."]
1572 MAV_CMD_CONFIGURE_ACTUATOR = 311,
1573 #[doc = "Arms / Disarms a component"]
1574 MAV_CMD_COMPONENT_ARM_DISARM = 400,
1575 #[doc = "Instructs a target system to run pre-arm checks. This allows preflight checks to be run on demand, which may be useful on systems that normally run them at low rate, or which do not trigger checks when the armable state might have changed. This command should return MAV_RESULT_ACCEPTED if it will run the checks. The results of the checks are usually then reported in SYS_STATUS messages (this is system-specific). The command should return MAV_RESULT_TEMPORARILY_REJECTED if the system is already armed."]
1576 MAV_CMD_RUN_PREARM_CHECKS = 401,
1577 #[doc = "Turns illuminators ON/OFF. An illuminator is a light source that is used for lighting up dark areas external to the system: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
1578 MAV_CMD_ILLUMINATOR_ON_OFF = 405,
1579 #[doc = "Configures illuminator settings. An illuminator is a light source that is used for lighting up dark areas external to the system: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
1580 MAV_CMD_DO_ILLUMINATOR_CONFIGURE = 406,
1581 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2022-04)"]
1582 #[doc = "Request the home position from the vehicle. \t The vehicle will ACK the command and then emit the HOME_POSITION message."]
1583 MAV_CMD_GET_HOME_POSITION = 410,
1584 #[doc = "Inject artificial failure for testing purposes. Note that autopilots should implement an additional protection before accepting this command such as a specific param setting."]
1585 MAV_CMD_INJECT_FAILURE = 420,
1586 #[doc = "Starts receiver pairing."]
1587 MAV_CMD_START_RX_PAIR = 500,
1588 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2022-04)"]
1589 #[doc = "Request the interval between messages for a particular MAVLink message ID. The receiver should ACK the command and then emit its response in a MESSAGE_INTERVAL message."]
1590 MAV_CMD_GET_MESSAGE_INTERVAL = 510,
1591 #[doc = "Set the interval between messages for a particular MAVLink message ID. This interface replaces REQUEST_DATA_STREAM."]
1592 MAV_CMD_SET_MESSAGE_INTERVAL = 511,
1593 #[doc = "Request the target system(s) emit a single instance of a specified message (i.e. a \"one-shot\" version of MAV_CMD_SET_MESSAGE_INTERVAL)."]
1594 MAV_CMD_REQUEST_MESSAGE = 512,
1595 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1596 #[doc = "Request MAVLink protocol version compatibility. All receivers should ACK the command and then emit their capabilities in an PROTOCOL_VERSION message"]
1597 MAV_CMD_REQUEST_PROTOCOL_VERSION = 519,
1598 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1599 #[doc = "Request autopilot capabilities. The receiver should ACK the command and then emit its capabilities in an AUTOPILOT_VERSION message"]
1600 MAV_CMD_REQUEST_AUTOPILOT_CAPABILITIES = 520,
1601 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1602 #[doc = "Request camera information (CAMERA_INFORMATION)."]
1603 MAV_CMD_REQUEST_CAMERA_INFORMATION = 521,
1604 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1605 #[doc = "Request camera settings (CAMERA_SETTINGS)."]
1606 MAV_CMD_REQUEST_CAMERA_SETTINGS = 522,
1607 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1608 #[doc = "Request storage information (STORAGE_INFORMATION). Use the command's target_component to target a specific component's storage."]
1609 MAV_CMD_REQUEST_STORAGE_INFORMATION = 525,
1610 #[doc = "Format a storage medium. Once format is complete, a STORAGE_INFORMATION message is sent. Use the command's target_component to target a specific component's storage."]
1611 MAV_CMD_STORAGE_FORMAT = 526,
1612 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1613 #[doc = "Request camera capture status (CAMERA_CAPTURE_STATUS)"]
1614 MAV_CMD_REQUEST_CAMERA_CAPTURE_STATUS = 527,
1615 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1616 #[doc = "Request flight information (FLIGHT_INFORMATION)"]
1617 MAV_CMD_REQUEST_FLIGHT_INFORMATION = 528,
1618 #[doc = "Reset all camera settings to Factory Default"]
1619 MAV_CMD_RESET_CAMERA_SETTINGS = 529,
1620 #[doc = "Set camera running mode. Use NaN for reserved values. GCS will send a MAV_CMD_REQUEST_VIDEO_STREAM_STATUS command after a mode change if the camera supports video streaming."]
1621 MAV_CMD_SET_CAMERA_MODE = 530,
1622 #[doc = "Set camera zoom. Camera must respond with a CAMERA_SETTINGS message (on success)."]
1623 MAV_CMD_SET_CAMERA_ZOOM = 531,
1624 #[doc = "Set camera focus. Camera must respond with a CAMERA_SETTINGS message (on success)."]
1625 MAV_CMD_SET_CAMERA_FOCUS = 532,
1626 #[doc = "Set that a particular storage is the preferred location for saving photos, videos, and/or other media (e.g. to set that an SD card is used for storing videos). There can only be one preferred save location for each particular media type: setting a media usage flag will clear/reset that same flag if set on any other storage. If no flag is set the system should use its default storage. A target system can choose to always use default storage, in which case it should ACK the command with MAV_RESULT_UNSUPPORTED. A target system can choose to not allow a particular storage to be set as preferred storage, in which case it should ACK the command with MAV_RESULT_DENIED."]
1627 MAV_CMD_SET_STORAGE_USAGE = 533,
1628 #[doc = "Set camera source. Changes the camera's active sources on cameras with multiple image sensors."]
1629 MAV_CMD_SET_CAMERA_SOURCE = 534,
1630 #[doc = "Tagged jump target. Can be jumped to with MAV_CMD_DO_JUMP_TAG."]
1631 MAV_CMD_JUMP_TAG = 600,
1632 #[doc = "Jump to the matching tag in the mission list. Repeat this action for the specified number of times. A mission should contain a single matching tag for each jump. If this is not the case then a jump to a missing tag should complete the mission, and a jump where there are multiple matching tags should always select the one with the lowest mission sequence number."]
1633 MAV_CMD_DO_JUMP_TAG = 601,
1634 #[doc = "Set gimbal manager pitch/yaw setpoints (low rate command). It is possible to set combinations of the values below. E.g. an angle as well as a desired angular rate can be used to get to this angle at a certain angular rate, or an angular rate only will result in continuous turning. NaN is to be used to signal unset. Note: only the gimbal manager will react to this command - it will be ignored by a gimbal device. Use GIMBAL_MANAGER_SET_PITCHYAW if you need to stream pitch/yaw setpoints at higher rate."]
1635 MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW = 1000,
1636 #[doc = "Gimbal configuration to set which sysid/compid is in primary and secondary control."]
1637 MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE = 1001,
1638 #[doc = "Start image capture sequence. CAMERA_IMAGE_CAPTURED must be emitted after each capture. Param1 (id) may be used to specify the target camera: 0: all cameras, 1 to 6: autopilot-connected cameras, 7-255: MAVLink camera component ID. It is needed in order to target specific cameras connected to the autopilot, or specific sensors in a multi-sensor camera (neither of which have a distinct MAVLink component ID). It is also needed to specify the target camera in missions. When used in a mission, an autopilot should execute the MAV_CMD for a specified local camera (param1 = 1-6), or resend it as a command if it is intended for a MAVLink camera (param1 = 7 - 255), setting the command's target_component as the param1 value (and setting param1 in the command to zero). If the param1 is 0 the autopilot should do both. When sent in a command the target MAVLink address is set using target_component. If addressed specifically to an autopilot: param1 should be used in the same way as it is for missions (though command should NACK with MAV_RESULT_DENIED if a specified local camera does not exist). If addressed to a MAVLink camera, param 1 can be used to address all cameras (0), or to separately address 1 to 7 individual sensors. Other values should be NACKed with MAV_RESULT_DENIED. If the command is broadcast (target_component is 0) then param 1 should be set to 0 (any other value should be NACKED with MAV_RESULT_DENIED). An autopilot would trigger any local cameras and forward the command to all channels."]
1639 MAV_CMD_IMAGE_START_CAPTURE = 2000,
1640 #[doc = "Stop image capture sequence. Param1 (id) may be used to specify the target camera: 0: all cameras, 1 to 6: autopilot-connected cameras, 7-255: MAVLink camera component ID. It is needed in order to target specific cameras connected to the autopilot, or specific sensors in a multi-sensor camera (neither of which have a distinct MAVLink component ID). It is also needed to specify the target camera in missions. When used in a mission, an autopilot should execute the MAV_CMD for a specified local camera (param1 = 1-6), or resend it as a command if it is intended for a MAVLink camera (param1 = 7 - 255), setting the command's target_component as the param1 value (and setting param1 in the command to zero). If the param1 is 0 the autopilot should do both. When sent in a command the target MAVLink address is set using target_component. If addressed specifically to an autopilot: param1 should be used in the same way as it is for missions (though command should NACK with MAV_RESULT_DENIED if a specified local camera does not exist). If addressed to a MAVLink camera, param1 can be used to address all cameras (0), or to separately address 1 to 7 individual sensors. Other values should be NACKed with MAV_RESULT_DENIED. If the command is broadcast (target_component is 0) then param 1 should be set to 0 (any other value should be NACKED with MAV_RESULT_DENIED). An autopilot would trigger any local cameras and forward the command to all channels."]
1641 MAV_CMD_IMAGE_STOP_CAPTURE = 2001,
1642 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1643 #[doc = "Re-request a CAMERA_IMAGE_CAPTURED message."]
1644 MAV_CMD_REQUEST_CAMERA_IMAGE_CAPTURE = 2002,
1645 #[doc = "Enable or disable on-board camera triggering system."]
1646 MAV_CMD_DO_TRIGGER_CONTROL = 2003,
1647 #[doc = "If the camera supports point visual tracking (CAMERA_CAP_FLAGS_HAS_TRACKING_POINT is set), this command allows to initiate the tracking."]
1648 MAV_CMD_CAMERA_TRACK_POINT = 2004,
1649 #[doc = "If the camera supports rectangle visual tracking (CAMERA_CAP_FLAGS_HAS_TRACKING_RECTANGLE is set), this command allows to initiate the tracking."]
1650 MAV_CMD_CAMERA_TRACK_RECTANGLE = 2005,
1651 #[doc = "Stops ongoing tracking."]
1652 MAV_CMD_CAMERA_STOP_TRACKING = 2010,
1653 #[doc = "Starts video capture (recording)."]
1654 MAV_CMD_VIDEO_START_CAPTURE = 2500,
1655 #[doc = "Stop the current video capture (recording)."]
1656 MAV_CMD_VIDEO_STOP_CAPTURE = 2501,
1657 #[doc = "Start video streaming"]
1658 MAV_CMD_VIDEO_START_STREAMING = 2502,
1659 #[doc = "Stop the given video stream"]
1660 MAV_CMD_VIDEO_STOP_STREAMING = 2503,
1661 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1662 #[doc = "Request video stream information (VIDEO_STREAM_INFORMATION)"]
1663 MAV_CMD_REQUEST_VIDEO_STREAM_INFORMATION = 2504,
1664 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1665 #[doc = "Request video stream status (VIDEO_STREAM_STATUS)"]
1666 MAV_CMD_REQUEST_VIDEO_STREAM_STATUS = 2505,
1667 #[doc = "Request to start streaming logging data over MAVLink (see also LOGGING_DATA message)"]
1668 MAV_CMD_LOGGING_START = 2510,
1669 #[doc = "Request to stop streaming log data over MAVLink"]
1670 MAV_CMD_LOGGING_STOP = 2511,
1671 MAV_CMD_AIRFRAME_CONFIGURATION = 2520,
1672 #[doc = "Request to start/stop transmitting over the high latency telemetry"]
1673 MAV_CMD_CONTROL_HIGH_LATENCY = 2600,
1674 #[doc = "Create a panorama at the current position"]
1675 MAV_CMD_PANORAMA_CREATE = 2800,
1676 #[doc = "Request VTOL transition"]
1677 MAV_CMD_DO_VTOL_TRANSITION = 3000,
1678 #[doc = "Request authorization to arm the vehicle to a external entity, the arm authorizer is responsible to request all data that is needs from the vehicle before authorize or deny the request. \t\tIf approved the COMMAND_ACK message progress field should be set with period of time that this authorization is valid in seconds. \t\tIf the authorization is denied COMMAND_ACK.result_param2 should be set with one of the reasons in ARM_AUTH_DENIED_REASON."]
1679 MAV_CMD_ARM_AUTHORIZATION_REQUEST = 3001,
1680 #[doc = "This command sets the submode to standard guided when vehicle is in guided mode. The vehicle holds position and altitude and the user can input the desired velocities along all three axes."]
1681 MAV_CMD_SET_GUIDED_SUBMODE_STANDARD = 4000,
1682 #[doc = "This command sets submode circle when vehicle is in guided mode. Vehicle flies along a circle facing the center of the circle. The user can input the velocity along the circle and change the radius. If no input is given the vehicle will hold position."]
1683 MAV_CMD_SET_GUIDED_SUBMODE_CIRCLE = 4001,
1684 #[doc = "Delay mission state machine until gate has been reached."]
1685 MAV_CMD_CONDITION_GATE = 4501,
1686 #[doc = "Fence return point (there can only be one such point in a geofence definition). If rally points are supported they should be used instead."]
1687 MAV_CMD_NAV_FENCE_RETURN_POINT = 5000,
1688 #[doc = "Fence vertex for an inclusion polygon (the polygon must not be self-intersecting). The vehicle must stay within this area. Minimum of 3 vertices required. The vertices for a polygon must be sent sequentially, each with param1 set to the total number of vertices in the polygon."]
1689 MAV_CMD_NAV_FENCE_POLYGON_VERTEX_INCLUSION = 5001,
1690 #[doc = "Fence vertex for an exclusion polygon (the polygon must not be self-intersecting). The vehicle must stay outside this area. Minimum of 3 vertices required. The vertices for a polygon must be sent sequentially, each with param1 set to the total number of vertices in the polygon."]
1691 MAV_CMD_NAV_FENCE_POLYGON_VERTEX_EXCLUSION = 5002,
1692 #[doc = "Circular fence area. The vehicle must stay inside this area."]
1693 MAV_CMD_NAV_FENCE_CIRCLE_INCLUSION = 5003,
1694 #[doc = "Circular fence area. The vehicle must stay outside this area."]
1695 MAV_CMD_NAV_FENCE_CIRCLE_EXCLUSION = 5004,
1696 #[doc = "Rally point. You can have multiple rally points defined."]
1697 MAV_CMD_NAV_RALLY_POINT = 5100,
1698 #[doc = "Commands the vehicle to respond with a sequence of messages UAVCAN_NODE_INFO, one message per every UAVCAN node that is online. Note that some of the response messages can be lost, which the receiver can detect easily by checking whether every received UAVCAN_NODE_STATUS has a matching message UAVCAN_NODE_INFO received earlier; if not, this command should be sent again in order to request re-transmission of the node information messages."]
1699 MAV_CMD_UAVCAN_GET_NODE_INFO = 5200,
1700 #[doc = "Change state of safety switch."]
1701 MAV_CMD_DO_SET_SAFETY_SWITCH_STATE = 5300,
1702 #[doc = "Trigger the start of an ADSB-out IDENT. This should only be used when requested to do so by an Air Traffic Controller in controlled airspace. This starts the IDENT which is then typically held for 18 seconds by the hardware per the Mode A, C, and S transponder spec."]
1703 MAV_CMD_DO_ADSB_OUT_IDENT = 10001,
1704 #[deprecated = " (Deprecated since 2021-06)"]
1705 #[doc = "Deploy payload on a Lat / Lon / Alt position. This includes the navigation to reach the required release position and velocity."]
1706 MAV_CMD_PAYLOAD_PREPARE_DEPLOY = 30001,
1707 #[deprecated = " (Deprecated since 2021-06)"]
1708 #[doc = "Control the payload deployment."]
1709 MAV_CMD_PAYLOAD_CONTROL_DEPLOY = 30002,
1710 #[doc = "Magnetometer calibration based on provided known yaw. This allows for fast calibration using WMM field tables in the vehicle, given only the known yaw of the vehicle. If Latitude and longitude are both zero then use the current vehicle location."]
1711 MAV_CMD_FIXED_MAG_CAL_YAW = 42006,
1712 #[doc = "Command to operate winch."]
1713 MAV_CMD_DO_WINCH = 42600,
1714 #[doc = "Provide an external position estimate for use when dead-reckoning. This is meant to be used for occasional position resets that may be provided by a external system such as a remote pilot using landmarks over a video link."]
1715 MAV_CMD_EXTERNAL_POSITION_ESTIMATE = 43003,
1716 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1717 MAV_CMD_WAYPOINT_USER_1 = 31000,
1718 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1719 MAV_CMD_WAYPOINT_USER_2 = 31001,
1720 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1721 MAV_CMD_WAYPOINT_USER_3 = 31002,
1722 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1723 MAV_CMD_WAYPOINT_USER_4 = 31003,
1724 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1725 MAV_CMD_WAYPOINT_USER_5 = 31004,
1726 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1727 MAV_CMD_SPATIAL_USER_1 = 31005,
1728 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1729 MAV_CMD_SPATIAL_USER_2 = 31006,
1730 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1731 MAV_CMD_SPATIAL_USER_3 = 31007,
1732 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1733 MAV_CMD_SPATIAL_USER_4 = 31008,
1734 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1735 MAV_CMD_SPATIAL_USER_5 = 31009,
1736 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1737 MAV_CMD_USER_1 = 31010,
1738 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1739 MAV_CMD_USER_2 = 31011,
1740 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1741 MAV_CMD_USER_3 = 31012,
1742 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1743 MAV_CMD_USER_4 = 31013,
1744 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1745 MAV_CMD_USER_5 = 31014,
1746 #[doc = "Request forwarding of CAN packets from the given CAN bus to this component. CAN Frames are sent using CAN_FRAME and CANFD_FRAME messages"]
1747 MAV_CMD_CAN_FORWARD = 32000,
1748}
1749impl MavCmd {
1750 pub const DEFAULT: Self = Self::MAV_CMD_NAV_WAYPOINT;
1751}
1752impl Default for MavCmd {
1753 fn default() -> Self {
1754 Self::DEFAULT
1755 }
1756}
1757#[cfg_attr(feature = "ts", derive(TS))]
1758#[cfg_attr(feature = "ts", ts(export))]
1759#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1760#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1761#[cfg_attr(feature = "serde", serde(tag = "type"))]
1762#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1763#[repr(u32)]
1764#[doc = "Possible actions an aircraft can take to avoid a collision."]
1765pub enum MavCollisionAction {
1766 #[doc = "Ignore any potential collisions"]
1767 MAV_COLLISION_ACTION_NONE = 0,
1768 #[doc = "Report potential collision"]
1769 MAV_COLLISION_ACTION_REPORT = 1,
1770 #[doc = "Ascend or Descend to avoid threat"]
1771 MAV_COLLISION_ACTION_ASCEND_OR_DESCEND = 2,
1772 #[doc = "Move horizontally to avoid threat"]
1773 MAV_COLLISION_ACTION_MOVE_HORIZONTALLY = 3,
1774 #[doc = "Aircraft to move perpendicular to the collision's velocity vector"]
1775 MAV_COLLISION_ACTION_MOVE_PERPENDICULAR = 4,
1776 #[doc = "Aircraft to fly directly back to its launch point"]
1777 MAV_COLLISION_ACTION_RTL = 5,
1778 #[doc = "Aircraft to stop in place"]
1779 MAV_COLLISION_ACTION_HOVER = 6,
1780}
1781impl MavCollisionAction {
1782 pub const DEFAULT: Self = Self::MAV_COLLISION_ACTION_NONE;
1783}
1784impl Default for MavCollisionAction {
1785 fn default() -> Self {
1786 Self::DEFAULT
1787 }
1788}
1789#[cfg_attr(feature = "ts", derive(TS))]
1790#[cfg_attr(feature = "ts", ts(export))]
1791#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1792#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1793#[cfg_attr(feature = "serde", serde(tag = "type"))]
1794#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1795#[repr(u32)]
1796#[doc = "Source of information about this collision."]
1797pub enum MavCollisionSrc {
1798 #[doc = "ID field references ADSB_VEHICLE packets"]
1799 MAV_COLLISION_SRC_ADSB = 0,
1800 #[doc = "ID field references MAVLink SRC ID"]
1801 MAV_COLLISION_SRC_MAVLINK_GPS_GLOBAL_INT = 1,
1802}
1803impl MavCollisionSrc {
1804 pub const DEFAULT: Self = Self::MAV_COLLISION_SRC_ADSB;
1805}
1806impl Default for MavCollisionSrc {
1807 fn default() -> Self {
1808 Self::DEFAULT
1809 }
1810}
1811#[cfg_attr(feature = "ts", derive(TS))]
1812#[cfg_attr(feature = "ts", ts(export))]
1813#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1814#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1815#[cfg_attr(feature = "serde", serde(tag = "type"))]
1816#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1817#[repr(u32)]
1818#[doc = "Aircraft-rated danger from this threat."]
1819pub enum MavCollisionThreatLevel {
1820 #[doc = "Not a threat"]
1821 MAV_COLLISION_THREAT_LEVEL_NONE = 0,
1822 #[doc = "Craft is mildly concerned about this threat"]
1823 MAV_COLLISION_THREAT_LEVEL_LOW = 1,
1824 #[doc = "Craft is panicking, and may take actions to avoid threat"]
1825 MAV_COLLISION_THREAT_LEVEL_HIGH = 2,
1826}
1827impl MavCollisionThreatLevel {
1828 pub const DEFAULT: Self = Self::MAV_COLLISION_THREAT_LEVEL_NONE;
1829}
1830impl Default for MavCollisionThreatLevel {
1831 fn default() -> Self {
1832 Self::DEFAULT
1833 }
1834}
1835#[cfg_attr(feature = "ts", derive(TS))]
1836#[cfg_attr(feature = "ts", ts(export))]
1837#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1838#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1839#[cfg_attr(feature = "serde", serde(tag = "type"))]
1840#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1841#[repr(u32)]
1842#[doc = "Component ids (values) for the different types and instances of onboard hardware/software that might make up a MAVLink system (autopilot, cameras, servos, GPS systems, avoidance systems etc.). Components must use the appropriate ID in their source address when sending messages. Components can also use IDs to determine if they are the intended recipient of an incoming message. The MAV_COMP_ID_ALL value is used to indicate messages that must be processed by all components. When creating new entries, components that can have multiple instances (e.g. cameras, servos etc.) should be allocated sequential values. An appropriate number of values should be left free after these components to allow the number of instances to be expanded."]
1843pub enum MavComponent {
1844 #[doc = "Target id (target_component) used to broadcast messages to all components of the receiving system. Components should attempt to process messages with this component ID and forward to components on any other interfaces. Note: This is not a valid *source* component id for a message."]
1845 MAV_COMP_ID_ALL = 0,
1846 #[doc = "System flight controller component (\"autopilot\"). Only one autopilot is expected in a particular system."]
1847 MAV_COMP_ID_AUTOPILOT1 = 1,
1848 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1849 MAV_COMP_ID_USER1 = 25,
1850 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1851 MAV_COMP_ID_USER2 = 26,
1852 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1853 MAV_COMP_ID_USER3 = 27,
1854 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1855 MAV_COMP_ID_USER4 = 28,
1856 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1857 MAV_COMP_ID_USER5 = 29,
1858 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1859 MAV_COMP_ID_USER6 = 30,
1860 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1861 MAV_COMP_ID_USER7 = 31,
1862 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1863 MAV_COMP_ID_USER8 = 32,
1864 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1865 MAV_COMP_ID_USER9 = 33,
1866 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1867 MAV_COMP_ID_USER10 = 34,
1868 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1869 MAV_COMP_ID_USER11 = 35,
1870 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1871 MAV_COMP_ID_USER12 = 36,
1872 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1873 MAV_COMP_ID_USER13 = 37,
1874 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1875 MAV_COMP_ID_USER14 = 38,
1876 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1877 MAV_COMP_ID_USER15 = 39,
1878 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1879 MAV_COMP_ID_USER16 = 40,
1880 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1881 MAV_COMP_ID_USER17 = 41,
1882 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1883 MAV_COMP_ID_USER18 = 42,
1884 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1885 MAV_COMP_ID_USER19 = 43,
1886 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1887 MAV_COMP_ID_USER20 = 44,
1888 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1889 MAV_COMP_ID_USER21 = 45,
1890 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1891 MAV_COMP_ID_USER22 = 46,
1892 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1893 MAV_COMP_ID_USER23 = 47,
1894 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1895 MAV_COMP_ID_USER24 = 48,
1896 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1897 MAV_COMP_ID_USER25 = 49,
1898 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1899 MAV_COMP_ID_USER26 = 50,
1900 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1901 MAV_COMP_ID_USER27 = 51,
1902 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1903 MAV_COMP_ID_USER28 = 52,
1904 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1905 MAV_COMP_ID_USER29 = 53,
1906 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1907 MAV_COMP_ID_USER30 = 54,
1908 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1909 MAV_COMP_ID_USER31 = 55,
1910 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1911 MAV_COMP_ID_USER32 = 56,
1912 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1913 MAV_COMP_ID_USER33 = 57,
1914 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1915 MAV_COMP_ID_USER34 = 58,
1916 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1917 MAV_COMP_ID_USER35 = 59,
1918 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1919 MAV_COMP_ID_USER36 = 60,
1920 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1921 MAV_COMP_ID_USER37 = 61,
1922 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1923 MAV_COMP_ID_USER38 = 62,
1924 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1925 MAV_COMP_ID_USER39 = 63,
1926 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1927 MAV_COMP_ID_USER40 = 64,
1928 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1929 MAV_COMP_ID_USER41 = 65,
1930 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1931 MAV_COMP_ID_USER42 = 66,
1932 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1933 MAV_COMP_ID_USER43 = 67,
1934 #[doc = "Telemetry radio (e.g. SiK radio, or other component that emits RADIO_STATUS messages)."]
1935 MAV_COMP_ID_TELEMETRY_RADIO = 68,
1936 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1937 MAV_COMP_ID_USER45 = 69,
1938 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1939 MAV_COMP_ID_USER46 = 70,
1940 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1941 MAV_COMP_ID_USER47 = 71,
1942 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1943 MAV_COMP_ID_USER48 = 72,
1944 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1945 MAV_COMP_ID_USER49 = 73,
1946 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1947 MAV_COMP_ID_USER50 = 74,
1948 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1949 MAV_COMP_ID_USER51 = 75,
1950 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1951 MAV_COMP_ID_USER52 = 76,
1952 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1953 MAV_COMP_ID_USER53 = 77,
1954 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1955 MAV_COMP_ID_USER54 = 78,
1956 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1957 MAV_COMP_ID_USER55 = 79,
1958 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1959 MAV_COMP_ID_USER56 = 80,
1960 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1961 MAV_COMP_ID_USER57 = 81,
1962 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1963 MAV_COMP_ID_USER58 = 82,
1964 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1965 MAV_COMP_ID_USER59 = 83,
1966 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1967 MAV_COMP_ID_USER60 = 84,
1968 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1969 MAV_COMP_ID_USER61 = 85,
1970 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1971 MAV_COMP_ID_USER62 = 86,
1972 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1973 MAV_COMP_ID_USER63 = 87,
1974 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1975 MAV_COMP_ID_USER64 = 88,
1976 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1977 MAV_COMP_ID_USER65 = 89,
1978 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1979 MAV_COMP_ID_USER66 = 90,
1980 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1981 MAV_COMP_ID_USER67 = 91,
1982 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1983 MAV_COMP_ID_USER68 = 92,
1984 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1985 MAV_COMP_ID_USER69 = 93,
1986 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1987 MAV_COMP_ID_USER70 = 94,
1988 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1989 MAV_COMP_ID_USER71 = 95,
1990 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1991 MAV_COMP_ID_USER72 = 96,
1992 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1993 MAV_COMP_ID_USER73 = 97,
1994 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1995 MAV_COMP_ID_USER74 = 98,
1996 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1997 MAV_COMP_ID_USER75 = 99,
1998 #[doc = "Camera #1."]
1999 MAV_COMP_ID_CAMERA = 100,
2000 #[doc = "Camera #2."]
2001 MAV_COMP_ID_CAMERA2 = 101,
2002 #[doc = "Camera #3."]
2003 MAV_COMP_ID_CAMERA3 = 102,
2004 #[doc = "Camera #4."]
2005 MAV_COMP_ID_CAMERA4 = 103,
2006 #[doc = "Camera #5."]
2007 MAV_COMP_ID_CAMERA5 = 104,
2008 #[doc = "Camera #6."]
2009 MAV_COMP_ID_CAMERA6 = 105,
2010 #[doc = "Servo #1."]
2011 MAV_COMP_ID_SERVO1 = 140,
2012 #[doc = "Servo #2."]
2013 MAV_COMP_ID_SERVO2 = 141,
2014 #[doc = "Servo #3."]
2015 MAV_COMP_ID_SERVO3 = 142,
2016 #[doc = "Servo #4."]
2017 MAV_COMP_ID_SERVO4 = 143,
2018 #[doc = "Servo #5."]
2019 MAV_COMP_ID_SERVO5 = 144,
2020 #[doc = "Servo #6."]
2021 MAV_COMP_ID_SERVO6 = 145,
2022 #[doc = "Servo #7."]
2023 MAV_COMP_ID_SERVO7 = 146,
2024 #[doc = "Servo #8."]
2025 MAV_COMP_ID_SERVO8 = 147,
2026 #[doc = "Servo #9."]
2027 MAV_COMP_ID_SERVO9 = 148,
2028 #[doc = "Servo #10."]
2029 MAV_COMP_ID_SERVO10 = 149,
2030 #[doc = "Servo #11."]
2031 MAV_COMP_ID_SERVO11 = 150,
2032 #[doc = "Servo #12."]
2033 MAV_COMP_ID_SERVO12 = 151,
2034 #[doc = "Servo #13."]
2035 MAV_COMP_ID_SERVO13 = 152,
2036 #[doc = "Servo #14."]
2037 MAV_COMP_ID_SERVO14 = 153,
2038 #[doc = "Gimbal #1."]
2039 MAV_COMP_ID_GIMBAL = 154,
2040 #[doc = "Logging component."]
2041 MAV_COMP_ID_LOG = 155,
2042 #[doc = "Automatic Dependent Surveillance-Broadcast (ADS-B) component."]
2043 MAV_COMP_ID_ADSB = 156,
2044 #[doc = "On Screen Display (OSD) devices for video links."]
2045 MAV_COMP_ID_OSD = 157,
2046 #[doc = "Generic autopilot peripheral component ID. Meant for devices that do not implement the parameter microservice."]
2047 MAV_COMP_ID_PERIPHERAL = 158,
2048 #[deprecated = "All gimbals should use MAV_COMP_ID_GIMBAL. See `MAV_COMP_ID_GIMBAL` (Deprecated since 2018-11)"]
2049 #[doc = "Gimbal ID for QX1."]
2050 MAV_COMP_ID_QX1_GIMBAL = 159,
2051 #[doc = "FLARM collision alert component."]
2052 MAV_COMP_ID_FLARM = 160,
2053 #[doc = "Parachute component."]
2054 MAV_COMP_ID_PARACHUTE = 161,
2055 #[doc = "Winch component."]
2056 MAV_COMP_ID_WINCH = 169,
2057 #[doc = "Gimbal #2."]
2058 MAV_COMP_ID_GIMBAL2 = 171,
2059 #[doc = "Gimbal #3."]
2060 MAV_COMP_ID_GIMBAL3 = 172,
2061 #[doc = "Gimbal #4"]
2062 MAV_COMP_ID_GIMBAL4 = 173,
2063 #[doc = "Gimbal #5."]
2064 MAV_COMP_ID_GIMBAL5 = 174,
2065 #[doc = "Gimbal #6."]
2066 MAV_COMP_ID_GIMBAL6 = 175,
2067 #[doc = "Battery #1."]
2068 MAV_COMP_ID_BATTERY = 180,
2069 #[doc = "Battery #2."]
2070 MAV_COMP_ID_BATTERY2 = 181,
2071 #[doc = "CAN over MAVLink client."]
2072 MAV_COMP_ID_MAVCAN = 189,
2073 #[doc = "Component that can generate/supply a mission flight plan (e.g. GCS or developer API)."]
2074 MAV_COMP_ID_MISSIONPLANNER = 190,
2075 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2076 MAV_COMP_ID_ONBOARD_COMPUTER = 191,
2077 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2078 MAV_COMP_ID_ONBOARD_COMPUTER2 = 192,
2079 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2080 MAV_COMP_ID_ONBOARD_COMPUTER3 = 193,
2081 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2082 MAV_COMP_ID_ONBOARD_COMPUTER4 = 194,
2083 #[doc = "Component that finds an optimal path between points based on a certain constraint (e.g. minimum snap, shortest path, cost, etc.)."]
2084 MAV_COMP_ID_PATHPLANNER = 195,
2085 #[doc = "Component that plans a collision free path between two points."]
2086 MAV_COMP_ID_OBSTACLE_AVOIDANCE = 196,
2087 #[doc = "Component that provides position estimates using VIO techniques."]
2088 MAV_COMP_ID_VISUAL_INERTIAL_ODOMETRY = 197,
2089 #[doc = "Component that manages pairing of vehicle and GCS."]
2090 MAV_COMP_ID_PAIRING_MANAGER = 198,
2091 #[doc = "Inertial Measurement Unit (IMU) #1."]
2092 MAV_COMP_ID_IMU = 200,
2093 #[doc = "Inertial Measurement Unit (IMU) #2."]
2094 MAV_COMP_ID_IMU_2 = 201,
2095 #[doc = "Inertial Measurement Unit (IMU) #3."]
2096 MAV_COMP_ID_IMU_3 = 202,
2097 #[doc = "GPS #1."]
2098 MAV_COMP_ID_GPS = 220,
2099 #[doc = "GPS #2."]
2100 MAV_COMP_ID_GPS2 = 221,
2101 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
2102 MAV_COMP_ID_ODID_TXRX_1 = 236,
2103 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
2104 MAV_COMP_ID_ODID_TXRX_2 = 237,
2105 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
2106 MAV_COMP_ID_ODID_TXRX_3 = 238,
2107 #[doc = "Component to bridge MAVLink to UDP (i.e. from a UART)."]
2108 MAV_COMP_ID_UDP_BRIDGE = 240,
2109 #[doc = "Component to bridge to UART (i.e. from UDP)."]
2110 MAV_COMP_ID_UART_BRIDGE = 241,
2111 #[doc = "Component handling TUNNEL messages (e.g. vendor specific GUI of a component)."]
2112 MAV_COMP_ID_TUNNEL_NODE = 242,
2113 #[doc = "Illuminator"]
2114 MAV_COMP_ID_ILLUMINATOR = 243,
2115 #[deprecated = "System control does not require a separate component ID. Instead, system commands should be sent with target_component=MAV_COMP_ID_ALL allowing the target component to use any appropriate component id. See `MAV_COMP_ID_ALL` (Deprecated since 2018-11)"]
2116 #[doc = "Deprecated, don't use. Component for handling system messages (e.g. to ARM, takeoff, etc.)."]
2117 MAV_COMP_ID_SYSTEM_CONTROL = 250,
2118}
2119impl MavComponent {
2120 pub const DEFAULT: Self = Self::MAV_COMP_ID_ALL;
2121}
2122impl Default for MavComponent {
2123 fn default() -> Self {
2124 Self::DEFAULT
2125 }
2126}
2127#[cfg_attr(feature = "ts", derive(TS))]
2128#[cfg_attr(feature = "ts", ts(export))]
2129#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2130#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2131#[cfg_attr(feature = "serde", serde(tag = "type"))]
2132#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2133#[repr(u32)]
2134#[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-06)"]
2135#[doc = "A data stream is not a fixed set of messages, but rather a recommendation to the autopilot software. Individual autopilots may or may not obey the recommended messages."]
2136pub enum MavDataStream {
2137 #[doc = "Enable all data streams"]
2138 MAV_DATA_STREAM_ALL = 0,
2139 #[doc = "Enable IMU_RAW, GPS_RAW, GPS_STATUS packets."]
2140 MAV_DATA_STREAM_RAW_SENSORS = 1,
2141 #[doc = "Enable GPS_STATUS, CONTROL_STATUS, AUX_STATUS"]
2142 MAV_DATA_STREAM_EXTENDED_STATUS = 2,
2143 #[doc = "Enable RC_CHANNELS_SCALED, RC_CHANNELS_RAW, SERVO_OUTPUT_RAW"]
2144 MAV_DATA_STREAM_RC_CHANNELS = 3,
2145 #[doc = "Enable ATTITUDE_CONTROLLER_OUTPUT, POSITION_CONTROLLER_OUTPUT, NAV_CONTROLLER_OUTPUT."]
2146 MAV_DATA_STREAM_RAW_CONTROLLER = 4,
2147 #[doc = "Enable LOCAL_POSITION, GLOBAL_POSITION_INT messages."]
2148 MAV_DATA_STREAM_POSITION = 6,
2149 #[doc = "Dependent on the autopilot"]
2150 MAV_DATA_STREAM_EXTRA1 = 10,
2151 #[doc = "Dependent on the autopilot"]
2152 MAV_DATA_STREAM_EXTRA2 = 11,
2153 #[doc = "Dependent on the autopilot"]
2154 MAV_DATA_STREAM_EXTRA3 = 12,
2155}
2156impl MavDataStream {
2157 pub const DEFAULT: Self = Self::MAV_DATA_STREAM_ALL;
2158}
2159impl Default for MavDataStream {
2160 fn default() -> Self {
2161 Self::DEFAULT
2162 }
2163}
2164#[cfg_attr(feature = "ts", derive(TS))]
2165#[cfg_attr(feature = "ts", ts(export))]
2166#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2167#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2168#[cfg_attr(feature = "serde", serde(tag = "type"))]
2169#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2170#[repr(u32)]
2171#[doc = "Enumeration of distance sensor types"]
2172pub enum MavDistanceSensor {
2173 #[doc = "Laser rangefinder, e.g. LightWare SF02/F or PulsedLight units"]
2174 MAV_DISTANCE_SENSOR_LASER = 0,
2175 #[doc = "Ultrasound rangefinder, e.g. MaxBotix units"]
2176 MAV_DISTANCE_SENSOR_ULTRASOUND = 1,
2177 #[doc = "Infrared rangefinder, e.g. Sharp units"]
2178 MAV_DISTANCE_SENSOR_INFRARED = 2,
2179 #[doc = "Radar type, e.g. uLanding units"]
2180 MAV_DISTANCE_SENSOR_RADAR = 3,
2181 #[doc = "Broken or unknown type, e.g. analog units"]
2182 MAV_DISTANCE_SENSOR_UNKNOWN = 4,
2183}
2184impl MavDistanceSensor {
2185 pub const DEFAULT: Self = Self::MAV_DISTANCE_SENSOR_LASER;
2186}
2187impl Default for MavDistanceSensor {
2188 fn default() -> Self {
2189 Self::DEFAULT
2190 }
2191}
2192#[cfg_attr(feature = "ts", derive(TS))]
2193#[cfg_attr(feature = "ts", ts(export))]
2194#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2195#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2196#[cfg_attr(feature = "serde", serde(tag = "type"))]
2197#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2198#[repr(u32)]
2199#[doc = "Bitmap of options for the MAV_CMD_DO_REPOSITION"]
2200pub enum MavDoRepositionFlags {
2201 #[doc = "The aircraft should immediately transition into guided. This should not be set for follow me applications"]
2202 MAV_DO_REPOSITION_FLAGS_CHANGE_MODE = 1,
2203}
2204impl MavDoRepositionFlags {
2205 pub const DEFAULT: Self = Self::MAV_DO_REPOSITION_FLAGS_CHANGE_MODE;
2206}
2207impl Default for MavDoRepositionFlags {
2208 fn default() -> Self {
2209 Self::DEFAULT
2210 }
2211}
2212#[cfg_attr(feature = "ts", derive(TS))]
2213#[cfg_attr(feature = "ts", ts(export))]
2214#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2215#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2216#[cfg_attr(feature = "serde", serde(tag = "type"))]
2217#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2218#[repr(u32)]
2219#[doc = "Enumeration of estimator types"]
2220pub enum MavEstimatorType {
2221 #[doc = "Unknown type of the estimator."]
2222 MAV_ESTIMATOR_TYPE_UNKNOWN = 0,
2223 #[doc = "This is a naive estimator without any real covariance feedback."]
2224 MAV_ESTIMATOR_TYPE_NAIVE = 1,
2225 #[doc = "Computer vision based estimate. Might be up to scale."]
2226 MAV_ESTIMATOR_TYPE_VISION = 2,
2227 #[doc = "Visual-inertial estimate."]
2228 MAV_ESTIMATOR_TYPE_VIO = 3,
2229 #[doc = "Plain GPS estimate."]
2230 MAV_ESTIMATOR_TYPE_GPS = 4,
2231 #[doc = "Estimator integrating GPS and inertial sensing."]
2232 MAV_ESTIMATOR_TYPE_GPS_INS = 5,
2233 #[doc = "Estimate from external motion capturing system."]
2234 MAV_ESTIMATOR_TYPE_MOCAP = 6,
2235 #[doc = "Estimator based on lidar sensor input."]
2236 MAV_ESTIMATOR_TYPE_LIDAR = 7,
2237 #[doc = "Estimator on autopilot."]
2238 MAV_ESTIMATOR_TYPE_AUTOPILOT = 8,
2239}
2240impl MavEstimatorType {
2241 pub const DEFAULT: Self = Self::MAV_ESTIMATOR_TYPE_UNKNOWN;
2242}
2243impl Default for MavEstimatorType {
2244 fn default() -> Self {
2245 Self::DEFAULT
2246 }
2247}
2248#[cfg_attr(feature = "ts", derive(TS))]
2249#[cfg_attr(feature = "ts", ts(export))]
2250#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2251#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2252#[cfg_attr(feature = "serde", serde(tag = "type"))]
2253#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2254#[repr(u32)]
2255#[doc = "Flags for CURRENT_EVENT_SEQUENCE."]
2256pub enum MavEventCurrentSequenceFlags {
2257 #[doc = "A sequence reset has happened (e.g. vehicle reboot)."]
2258 MAV_EVENT_CURRENT_SEQUENCE_FLAGS_RESET = 1,
2259}
2260impl MavEventCurrentSequenceFlags {
2261 pub const DEFAULT: Self = Self::MAV_EVENT_CURRENT_SEQUENCE_FLAGS_RESET;
2262}
2263impl Default for MavEventCurrentSequenceFlags {
2264 fn default() -> Self {
2265 Self::DEFAULT
2266 }
2267}
2268#[cfg_attr(feature = "ts", derive(TS))]
2269#[cfg_attr(feature = "ts", ts(export))]
2270#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2271#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2272#[cfg_attr(feature = "serde", serde(tag = "type"))]
2273#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2274#[repr(u32)]
2275#[doc = "Reason for an event error response."]
2276pub enum MavEventErrorReason {
2277 #[doc = "The requested event is not available (anymore)."]
2278 MAV_EVENT_ERROR_REASON_UNAVAILABLE = 0,
2279}
2280impl MavEventErrorReason {
2281 pub const DEFAULT: Self = Self::MAV_EVENT_ERROR_REASON_UNAVAILABLE;
2282}
2283impl Default for MavEventErrorReason {
2284 fn default() -> Self {
2285 Self::DEFAULT
2286 }
2287}
2288#[cfg_attr(feature = "ts", derive(TS))]
2289#[cfg_attr(feature = "ts", ts(export))]
2290#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2291#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2292#[cfg_attr(feature = "serde", serde(tag = "type"))]
2293#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2294#[repr(u32)]
2295#[doc = "Coordinate frames used by MAVLink. Not all frames are supported by all commands, messages, or vehicles. Global frames use the following naming conventions: - \"GLOBAL\": Global coordinate frame with WGS84 latitude/longitude and altitude positive over mean sea level (MSL) by default. The following modifiers may be used with \"GLOBAL\": - \"RELATIVE_ALT\": Altitude is relative to the vehicle home position rather than MSL. - \"TERRAIN_ALT\": Altitude is relative to ground level rather than MSL. - \"INT\": Latitude/longitude (in degrees) are scaled by multiplying by 1E7. Local frames use the following naming conventions: - \"LOCAL\": Origin of local frame is fixed relative to earth. Unless otherwise specified this origin is the origin of the vehicle position-estimator (\"EKF\"). - \"BODY\": Origin of local frame travels with the vehicle. NOTE, \"BODY\" does NOT indicate alignment of frame axis with vehicle attitude. - \"OFFSET\": Deprecated synonym for \"BODY\" (origin travels with the vehicle). Not to be used for new frames. Some deprecated frames do not follow these conventions (e.g. MAV_FRAME_BODY_NED and MAV_FRAME_BODY_OFFSET_NED)."]
2296pub enum MavFrame {
2297 #[doc = "Global (WGS84) coordinate frame + altitude relative to mean sea level (MSL)."]
2298 MAV_FRAME_GLOBAL = 0,
2299 #[doc = "NED local tangent frame (x: North, y: East, z: Down) with origin fixed relative to earth."]
2300 MAV_FRAME_LOCAL_NED = 1,
2301 #[doc = "NOT a coordinate frame, indicates a mission command."]
2302 MAV_FRAME_MISSION = 2,
2303 #[doc = "Global (WGS84) coordinate frame + altitude relative to the home position."]
2304 MAV_FRAME_GLOBAL_RELATIVE_ALT = 3,
2305 #[doc = "ENU local tangent frame (x: East, y: North, z: Up) with origin fixed relative to earth."]
2306 MAV_FRAME_LOCAL_ENU = 4,
2307 #[deprecated = "Use MAV_FRAME_GLOBAL in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL` (Deprecated since 2024-03)"]
2308 #[doc = "Global (WGS84) coordinate frame (scaled) + altitude relative to mean sea level (MSL)."]
2309 MAV_FRAME_GLOBAL_INT = 5,
2310 #[deprecated = "Use MAV_FRAME_GLOBAL_RELATIVE_ALT in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL_RELATIVE_ALT` (Deprecated since 2024-03)"]
2311 #[doc = "Global (WGS84) coordinate frame (scaled) + altitude relative to the home position."]
2312 MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6,
2313 #[doc = "NED local tangent frame (x: North, y: East, z: Down) with origin that travels with the vehicle."]
2314 MAV_FRAME_LOCAL_OFFSET_NED = 7,
2315 #[deprecated = " See `MAV_FRAME_BODY_FRD` (Deprecated since 2019-08)"]
2316 #[doc = "Same as MAV_FRAME_LOCAL_NED when used to represent position values. Same as MAV_FRAME_BODY_FRD when used with velocity/acceleration values."]
2317 MAV_FRAME_BODY_NED = 8,
2318 #[deprecated = " See `MAV_FRAME_BODY_FRD` (Deprecated since 2019-08)"]
2319 #[doc = "This is the same as MAV_FRAME_BODY_FRD."]
2320 MAV_FRAME_BODY_OFFSET_NED = 9,
2321 #[doc = "Global (WGS84) coordinate frame with AGL altitude (altitude at ground level)."]
2322 MAV_FRAME_GLOBAL_TERRAIN_ALT = 10,
2323 #[deprecated = "Use MAV_FRAME_GLOBAL_TERRAIN_ALT in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL_TERRAIN_ALT` (Deprecated since 2024-03)"]
2324 #[doc = "Global (WGS84) coordinate frame (scaled) with AGL altitude (altitude at ground level)."]
2325 MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11,
2326 #[doc = "FRD local frame aligned to the vehicle's attitude (x: Forward, y: Right, z: Down) with an origin that travels with vehicle."]
2327 MAV_FRAME_BODY_FRD = 12,
2328 #[deprecated = " (Deprecated since 2019-04)"]
2329 #[doc = "MAV_FRAME_BODY_FLU - Body fixed frame of reference, Z-up (x: Forward, y: Left, z: Up)."]
2330 MAV_FRAME_RESERVED_13 = 13,
2331 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
2332 #[doc = "MAV_FRAME_MOCAP_NED - Odometry local coordinate frame of data given by a motion capture system, Z-down (x: North, y: East, z: Down)."]
2333 MAV_FRAME_RESERVED_14 = 14,
2334 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
2335 #[doc = "MAV_FRAME_MOCAP_ENU - Odometry local coordinate frame of data given by a motion capture system, Z-up (x: East, y: North, z: Up)."]
2336 MAV_FRAME_RESERVED_15 = 15,
2337 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
2338 #[doc = "MAV_FRAME_VISION_NED - Odometry local coordinate frame of data given by a vision estimation system, Z-down (x: North, y: East, z: Down)."]
2339 MAV_FRAME_RESERVED_16 = 16,
2340 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
2341 #[doc = "MAV_FRAME_VISION_ENU - Odometry local coordinate frame of data given by a vision estimation system, Z-up (x: East, y: North, z: Up)."]
2342 MAV_FRAME_RESERVED_17 = 17,
2343 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
2344 #[doc = "MAV_FRAME_ESTIM_NED - Odometry local coordinate frame of data given by an estimator running onboard the vehicle, Z-down (x: North, y: East, z: Down)."]
2345 MAV_FRAME_RESERVED_18 = 18,
2346 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
2347 #[doc = "MAV_FRAME_ESTIM_ENU - Odometry local coordinate frame of data given by an estimator running onboard the vehicle, Z-up (x: East, y: North, z: Up)."]
2348 MAV_FRAME_RESERVED_19 = 19,
2349 #[doc = "FRD local tangent frame (x: Forward, y: Right, z: Down) with origin fixed relative to earth. The forward axis is aligned to the front of the vehicle in the horizontal plane."]
2350 MAV_FRAME_LOCAL_FRD = 20,
2351 #[doc = "FLU local tangent frame (x: Forward, y: Left, z: Up) with origin fixed relative to earth. The forward axis is aligned to the front of the vehicle in the horizontal plane."]
2352 MAV_FRAME_LOCAL_FLU = 21,
2353}
2354impl MavFrame {
2355 pub const DEFAULT: Self = Self::MAV_FRAME_GLOBAL;
2356}
2357impl Default for MavFrame {
2358 fn default() -> Self {
2359 Self::DEFAULT
2360 }
2361}
2362#[cfg_attr(feature = "ts", derive(TS))]
2363#[cfg_attr(feature = "ts", ts(export))]
2364#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2365#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2366#[cfg_attr(feature = "serde", serde(tag = "type"))]
2367#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2368#[repr(u32)]
2369#[doc = "MAV FTP error codes (<https://mavlink.io/en/services/ftp.html>)"]
2370pub enum MavFtpErr {
2371 #[doc = "None: No error"]
2372 MAV_FTP_ERR_NONE = 0,
2373 #[doc = "Fail: Unknown failure"]
2374 MAV_FTP_ERR_FAIL = 1,
2375 #[doc = "FailErrno: Command failed, Err number sent back in PayloadHeader.data[1]. \t\tThis is a file-system error number understood by the server operating system."]
2376 MAV_FTP_ERR_FAILERRNO = 2,
2377 #[doc = "InvalidDataSize: Payload size is invalid"]
2378 MAV_FTP_ERR_INVALIDDATASIZE = 3,
2379 #[doc = "InvalidSession: Session is not currently open"]
2380 MAV_FTP_ERR_INVALIDSESSION = 4,
2381 #[doc = "NoSessionsAvailable: All available sessions are already in use"]
2382 MAV_FTP_ERR_NOSESSIONSAVAILABLE = 5,
2383 #[doc = "EOF: Offset past end of file for ListDirectory and ReadFile commands"]
2384 MAV_FTP_ERR_EOF = 6,
2385 #[doc = "UnknownCommand: Unknown command / opcode"]
2386 MAV_FTP_ERR_UNKNOWNCOMMAND = 7,
2387 #[doc = "FileExists: File/directory already exists"]
2388 MAV_FTP_ERR_FILEEXISTS = 8,
2389 #[doc = "FileProtected: File/directory is write protected"]
2390 MAV_FTP_ERR_FILEPROTECTED = 9,
2391 #[doc = "FileNotFound: File/directory not found"]
2392 MAV_FTP_ERR_FILENOTFOUND = 10,
2393}
2394impl MavFtpErr {
2395 pub const DEFAULT: Self = Self::MAV_FTP_ERR_NONE;
2396}
2397impl Default for MavFtpErr {
2398 fn default() -> Self {
2399 Self::DEFAULT
2400 }
2401}
2402#[cfg_attr(feature = "ts", derive(TS))]
2403#[cfg_attr(feature = "ts", ts(export))]
2404#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2405#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2406#[cfg_attr(feature = "serde", serde(tag = "type"))]
2407#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2408#[repr(u32)]
2409#[doc = "MAV FTP opcodes: <https://mavlink.io/en/services/ftp.html>"]
2410pub enum MavFtpOpcode {
2411 #[doc = "None. Ignored, always ACKed"]
2412 MAV_FTP_OPCODE_NONE = 0,
2413 #[doc = "TerminateSession: Terminates open Read session"]
2414 MAV_FTP_OPCODE_TERMINATESESSION = 1,
2415 #[doc = "ResetSessions: Terminates all open read sessions"]
2416 MAV_FTP_OPCODE_RESETSESSION = 2,
2417 #[doc = "ListDirectory. List files and directories in path from offset"]
2418 MAV_FTP_OPCODE_LISTDIRECTORY = 3,
2419 #[doc = "OpenFileRO: Opens file at path for reading, returns session"]
2420 MAV_FTP_OPCODE_OPENFILERO = 4,
2421 #[doc = "ReadFile: Reads size bytes from offset in session"]
2422 MAV_FTP_OPCODE_READFILE = 5,
2423 #[doc = "CreateFile: Creates file at path for writing, returns session"]
2424 MAV_FTP_OPCODE_CREATEFILE = 6,
2425 #[doc = "WriteFile: Writes size bytes to offset in session"]
2426 MAV_FTP_OPCODE_WRITEFILE = 7,
2427 #[doc = "RemoveFile: Remove file at path"]
2428 MAV_FTP_OPCODE_REMOVEFILE = 8,
2429 #[doc = "CreateDirectory: Creates directory at path"]
2430 MAV_FTP_OPCODE_CREATEDIRECTORY = 9,
2431 #[doc = "RemoveDirectory: Removes directory at path. The directory must be empty."]
2432 MAV_FTP_OPCODE_REMOVEDIRECTORY = 10,
2433 #[doc = "OpenFileWO: Opens file at path for writing, returns session"]
2434 MAV_FTP_OPCODE_OPENFILEWO = 11,
2435 #[doc = "TruncateFile: Truncate file at path to offset length"]
2436 MAV_FTP_OPCODE_TRUNCATEFILE = 12,
2437 #[doc = "Rename: Rename path1 to path2"]
2438 MAV_FTP_OPCODE_RENAME = 13,
2439 #[doc = "CalcFileCRC32: Calculate CRC32 for file at path"]
2440 MAV_FTP_OPCODE_CALCFILECRC = 14,
2441 #[doc = "BurstReadFile: Burst download session file"]
2442 MAV_FTP_OPCODE_BURSTREADFILE = 15,
2443 #[doc = "ACK: ACK response"]
2444 MAV_FTP_OPCODE_ACK = 128,
2445 #[doc = "NAK: NAK response"]
2446 MAV_FTP_OPCODE_NAK = 129,
2447}
2448impl MavFtpOpcode {
2449 pub const DEFAULT: Self = Self::MAV_FTP_OPCODE_NONE;
2450}
2451impl Default for MavFtpOpcode {
2452 fn default() -> Self {
2453 Self::DEFAULT
2454 }
2455}
2456#[cfg_attr(feature = "ts", derive(TS))]
2457#[cfg_attr(feature = "ts", ts(export))]
2458#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2459#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2460#[cfg_attr(feature = "serde", serde(tag = "type"))]
2461#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2462#[repr(u32)]
2463#[doc = "Fuel types for use in FUEL_TYPE. Fuel types specify the units for the maximum, available and consumed fuel, and for the flow rates."]
2464pub enum MavFuelType {
2465 #[doc = "Not specified. Fuel levels are normalized (i.e. maximum is 1, and other levels are relative to 1)."]
2466 MAV_FUEL_TYPE_UNKNOWN = 0,
2467 #[doc = "A generic liquid fuel. Fuel levels are in millilitres (ml). Fuel rates are in millilitres/second."]
2468 MAV_FUEL_TYPE_LIQUID = 1,
2469 #[doc = "A gas tank. Fuel levels are in kilo-Pascal (kPa), and flow rates are in milliliters per second (ml/s)."]
2470 MAV_FUEL_TYPE_GAS = 2,
2471}
2472impl MavFuelType {
2473 pub const DEFAULT: Self = Self::MAV_FUEL_TYPE_UNKNOWN;
2474}
2475impl Default for MavFuelType {
2476 fn default() -> Self {
2477 Self::DEFAULT
2478 }
2479}
2480bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report status/failure cases for a power generator (used in GENERATOR_STATUS). Note that FAULTS are conditions that cause the generator to fail. Warnings are conditions that require attention before the next use (they indicate the system is not operating properly)."] pub struct MavGeneratorStatusFlag : u64 { # [doc = "Generator is off."] const MAV_GENERATOR_STATUS_FLAG_OFF = 1 ; # [doc = "Generator is ready to start generating power."] const MAV_GENERATOR_STATUS_FLAG_READY = 2 ; # [doc = "Generator is generating power."] const MAV_GENERATOR_STATUS_FLAG_GENERATING = 4 ; # [doc = "Generator is charging the batteries (generating enough power to charge and provide the load)."] const MAV_GENERATOR_STATUS_FLAG_CHARGING = 8 ; # [doc = "Generator is operating at a reduced maximum power."] const MAV_GENERATOR_STATUS_FLAG_REDUCED_POWER = 16 ; # [doc = "Generator is providing the maximum output."] const MAV_GENERATOR_STATUS_FLAG_MAXPOWER = 32 ; # [doc = "Generator is near the maximum operating temperature, cooling is insufficient."] const MAV_GENERATOR_STATUS_FLAG_OVERTEMP_WARNING = 64 ; # [doc = "Generator hit the maximum operating temperature and shutdown."] const MAV_GENERATOR_STATUS_FLAG_OVERTEMP_FAULT = 128 ; # [doc = "Power electronics are near the maximum operating temperature, cooling is insufficient."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_OVERTEMP_WARNING = 256 ; # [doc = "Power electronics hit the maximum operating temperature and shutdown."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_OVERTEMP_FAULT = 512 ; # [doc = "Power electronics experienced a fault and shutdown."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_FAULT = 1024 ; # [doc = "The power source supplying the generator failed e.g. mechanical generator stopped, tether is no longer providing power, solar cell is in shade, hydrogen reaction no longer happening."] const MAV_GENERATOR_STATUS_FLAG_POWERSOURCE_FAULT = 2048 ; # [doc = "Generator controller having communication problems."] const MAV_GENERATOR_STATUS_FLAG_COMMUNICATION_WARNING = 4096 ; # [doc = "Power electronic or generator cooling system error."] const MAV_GENERATOR_STATUS_FLAG_COOLING_WARNING = 8192 ; # [doc = "Generator controller power rail experienced a fault."] const MAV_GENERATOR_STATUS_FLAG_POWER_RAIL_FAULT = 16384 ; # [doc = "Generator controller exceeded the overcurrent threshold and shutdown to prevent damage."] const MAV_GENERATOR_STATUS_FLAG_OVERCURRENT_FAULT = 32768 ; # [doc = "Generator controller detected a high current going into the batteries and shutdown to prevent battery damage."] const MAV_GENERATOR_STATUS_FLAG_BATTERY_OVERCHARGE_CURRENT_FAULT = 65536 ; # [doc = "Generator controller exceeded it's overvoltage threshold and shutdown to prevent it exceeding the voltage rating."] const MAV_GENERATOR_STATUS_FLAG_OVERVOLTAGE_FAULT = 131072 ; # [doc = "Batteries are under voltage (generator will not start)."] const MAV_GENERATOR_STATUS_FLAG_BATTERY_UNDERVOLT_FAULT = 262144 ; # [doc = "Generator start is inhibited by e.g. a safety switch."] const MAV_GENERATOR_STATUS_FLAG_START_INHIBITED = 524288 ; # [doc = "Generator requires maintenance."] const MAV_GENERATOR_STATUS_FLAG_MAINTENANCE_REQUIRED = 1048576 ; # [doc = "Generator is not ready to generate yet."] const MAV_GENERATOR_STATUS_FLAG_WARMING_UP = 2097152 ; # [doc = "Generator is idle."] const MAV_GENERATOR_STATUS_FLAG_IDLE = 4194304 ; } }
2481impl MavGeneratorStatusFlag {
2482 pub const DEFAULT: Self = Self::MAV_GENERATOR_STATUS_FLAG_OFF;
2483}
2484impl Default for MavGeneratorStatusFlag {
2485 fn default() -> Self {
2486 Self::DEFAULT
2487 }
2488}
2489#[cfg_attr(feature = "ts", derive(TS))]
2490#[cfg_attr(feature = "ts", ts(export))]
2491#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2492#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2493#[cfg_attr(feature = "serde", serde(tag = "type"))]
2494#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2495#[repr(u32)]
2496#[doc = "Actions that may be specified in MAV_CMD_OVERRIDE_GOTO to override mission execution."]
2497pub enum MavGoto {
2498 #[doc = "Hold at the current position."]
2499 MAV_GOTO_DO_HOLD = 0,
2500 #[doc = "Continue with the next item in mission execution."]
2501 MAV_GOTO_DO_CONTINUE = 1,
2502 #[doc = "Hold at the current position of the system"]
2503 MAV_GOTO_HOLD_AT_CURRENT_POSITION = 2,
2504 #[doc = "Hold at the position specified in the parameters of the DO_HOLD action"]
2505 MAV_GOTO_HOLD_AT_SPECIFIED_POSITION = 3,
2506}
2507impl MavGoto {
2508 pub const DEFAULT: Self = Self::MAV_GOTO_DO_HOLD;
2509}
2510impl Default for MavGoto {
2511 fn default() -> Self {
2512 Self::DEFAULT
2513 }
2514}
2515#[cfg_attr(feature = "ts", derive(TS))]
2516#[cfg_attr(feature = "ts", ts(export))]
2517#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2518#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2519#[cfg_attr(feature = "serde", serde(tag = "type"))]
2520#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2521#[repr(u32)]
2522#[doc = "Enumeration of landed detector states"]
2523pub enum MavLandedState {
2524 #[doc = "MAV landed state is unknown"]
2525 MAV_LANDED_STATE_UNDEFINED = 0,
2526 #[doc = "MAV is landed (on ground)"]
2527 MAV_LANDED_STATE_ON_GROUND = 1,
2528 #[doc = "MAV is in air"]
2529 MAV_LANDED_STATE_IN_AIR = 2,
2530 #[doc = "MAV currently taking off"]
2531 MAV_LANDED_STATE_TAKEOFF = 3,
2532 #[doc = "MAV currently landing"]
2533 MAV_LANDED_STATE_LANDING = 4,
2534}
2535impl MavLandedState {
2536 pub const DEFAULT: Self = Self::MAV_LANDED_STATE_UNDEFINED;
2537}
2538impl Default for MavLandedState {
2539 fn default() -> Self {
2540 Self::DEFAULT
2541 }
2542}
2543#[cfg_attr(feature = "ts", derive(TS))]
2544#[cfg_attr(feature = "ts", ts(export))]
2545#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2546#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2547#[cfg_attr(feature = "serde", serde(tag = "type"))]
2548#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2549#[repr(u32)]
2550#[doc = "Result of mission operation (in a MISSION_ACK message)."]
2551pub enum MavMissionResult {
2552 #[doc = "mission accepted OK"]
2553 MAV_MISSION_ACCEPTED = 0,
2554 #[doc = "Generic error / not accepting mission commands at all right now."]
2555 MAV_MISSION_ERROR = 1,
2556 #[doc = "Coordinate frame is not supported."]
2557 MAV_MISSION_UNSUPPORTED_FRAME = 2,
2558 #[doc = "Command is not supported."]
2559 MAV_MISSION_UNSUPPORTED = 3,
2560 #[doc = "Mission items exceed storage space."]
2561 MAV_MISSION_NO_SPACE = 4,
2562 #[doc = "One of the parameters has an invalid value."]
2563 MAV_MISSION_INVALID = 5,
2564 #[doc = "param1 has an invalid value."]
2565 MAV_MISSION_INVALID_PARAM1 = 6,
2566 #[doc = "param2 has an invalid value."]
2567 MAV_MISSION_INVALID_PARAM2 = 7,
2568 #[doc = "param3 has an invalid value."]
2569 MAV_MISSION_INVALID_PARAM3 = 8,
2570 #[doc = "param4 has an invalid value."]
2571 MAV_MISSION_INVALID_PARAM4 = 9,
2572 #[doc = "x / param5 has an invalid value."]
2573 MAV_MISSION_INVALID_PARAM5_X = 10,
2574 #[doc = "y / param6 has an invalid value."]
2575 MAV_MISSION_INVALID_PARAM6_Y = 11,
2576 #[doc = "z / param7 has an invalid value."]
2577 MAV_MISSION_INVALID_PARAM7 = 12,
2578 #[doc = "Mission item received out of sequence"]
2579 MAV_MISSION_INVALID_SEQUENCE = 13,
2580 #[doc = "Not accepting any mission commands from this communication partner."]
2581 MAV_MISSION_DENIED = 14,
2582 #[doc = "Current mission operation cancelled (e.g. mission upload, mission download)."]
2583 MAV_MISSION_OPERATION_CANCELLED = 15,
2584}
2585impl MavMissionResult {
2586 pub const DEFAULT: Self = Self::MAV_MISSION_ACCEPTED;
2587}
2588impl Default for MavMissionResult {
2589 fn default() -> Self {
2590 Self::DEFAULT
2591 }
2592}
2593#[cfg_attr(feature = "ts", derive(TS))]
2594#[cfg_attr(feature = "ts", ts(export))]
2595#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2596#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2597#[cfg_attr(feature = "serde", serde(tag = "type"))]
2598#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2599#[repr(u32)]
2600#[doc = "Type of mission items being requested/sent in mission protocol."]
2601pub enum MavMissionType {
2602 #[doc = "Items are mission commands for main mission."]
2603 MAV_MISSION_TYPE_MISSION = 0,
2604 #[doc = "Specifies GeoFence area(s). Items are MAV_CMD_NAV_FENCE_ GeoFence items."]
2605 MAV_MISSION_TYPE_FENCE = 1,
2606 #[doc = "Specifies the rally points for the vehicle. Rally points are alternative RTL points. Items are MAV_CMD_NAV_RALLY_POINT rally point items."]
2607 MAV_MISSION_TYPE_RALLY = 2,
2608 #[doc = "Only used in MISSION_CLEAR_ALL to clear all mission types."]
2609 MAV_MISSION_TYPE_ALL = 255,
2610}
2611impl MavMissionType {
2612 pub const DEFAULT: Self = Self::MAV_MISSION_TYPE_MISSION;
2613}
2614impl Default for MavMissionType {
2615 fn default() -> Self {
2616 Self::DEFAULT
2617 }
2618}
2619#[cfg_attr(feature = "ts", derive(TS))]
2620#[cfg_attr(feature = "ts", ts(export))]
2621#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2622#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2623#[cfg_attr(feature = "serde", serde(tag = "type"))]
2624#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2625#[repr(u32)]
2626#[doc = "These defines are predefined OR-combined mode flags. There is no need to use values from this enum, but it simplifies the use of the mode flags. Note that manual input is enabled in all modes as a safety override."]
2627pub enum MavMode {
2628 #[doc = "System is not ready to fly, booting, calibrating, etc. No flag is set."]
2629 MAV_MODE_PREFLIGHT = 0,
2630 #[doc = "System is allowed to be active, under assisted RC control."]
2631 MAV_MODE_STABILIZE_DISARMED = 80,
2632 #[doc = "System is allowed to be active, under assisted RC control."]
2633 MAV_MODE_STABILIZE_ARMED = 208,
2634 #[doc = "System is allowed to be active, under manual (RC) control, no stabilization"]
2635 MAV_MODE_MANUAL_DISARMED = 64,
2636 #[doc = "System is allowed to be active, under manual (RC) control, no stabilization"]
2637 MAV_MODE_MANUAL_ARMED = 192,
2638 #[doc = "System is allowed to be active, under autonomous control, manual setpoint"]
2639 MAV_MODE_GUIDED_DISARMED = 88,
2640 #[doc = "System is allowed to be active, under autonomous control, manual setpoint"]
2641 MAV_MODE_GUIDED_ARMED = 216,
2642 #[doc = "System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by waypoints)"]
2643 MAV_MODE_AUTO_DISARMED = 92,
2644 #[doc = "System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by waypoints)"]
2645 MAV_MODE_AUTO_ARMED = 220,
2646 #[doc = "UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only."]
2647 MAV_MODE_TEST_DISARMED = 66,
2648 #[doc = "UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only."]
2649 MAV_MODE_TEST_ARMED = 194,
2650}
2651impl MavMode {
2652 pub const DEFAULT: Self = Self::MAV_MODE_PREFLIGHT;
2653}
2654impl Default for MavMode {
2655 fn default() -> Self {
2656 Self::DEFAULT
2657 }
2658}
2659bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags encode the MAV mode."] pub struct MavModeFlag : u8 { # [doc = "0b10000000 MAV safety set to armed. Motors are enabled / running / can start. Ready to fly. Additional note: this flag is to be ignore when sent in the command MAV_CMD_DO_SET_MODE and MAV_CMD_COMPONENT_ARM_DISARM shall be used instead. The flag can still be used to report the armed state."] const MAV_MODE_FLAG_SAFETY_ARMED = 128 ; # [doc = "0b01000000 remote control input is enabled."] const MAV_MODE_FLAG_MANUAL_INPUT_ENABLED = 64 ; # [doc = "0b00100000 hardware in the loop simulation. All motors / actuators are blocked, but internal software is full operational."] const MAV_MODE_FLAG_HIL_ENABLED = 32 ; # [doc = "0b00010000 system stabilizes electronically its attitude (and optionally position). It needs however further control inputs to move around."] const MAV_MODE_FLAG_STABILIZE_ENABLED = 16 ; # [doc = "0b00001000 guided mode enabled, system flies waypoints / mission items."] const MAV_MODE_FLAG_GUIDED_ENABLED = 8 ; # [doc = "0b00000100 autonomous mode enabled, system finds its own goal positions. Guided flag can be set or not, depends on the actual implementation."] const MAV_MODE_FLAG_AUTO_ENABLED = 4 ; # [doc = "0b00000010 system has a test mode enabled. This flag is intended for temporary system tests and should not be used for stable implementations."] const MAV_MODE_FLAG_TEST_ENABLED = 2 ; # [doc = "0b00000001 Reserved for future use."] const MAV_MODE_FLAG_CUSTOM_MODE_ENABLED = 1 ; } }
2660impl MavModeFlag {
2661 pub const DEFAULT: Self = Self::MAV_MODE_FLAG_SAFETY_ARMED;
2662}
2663impl Default for MavModeFlag {
2664 fn default() -> Self {
2665 Self::DEFAULT
2666 }
2667}
2668#[cfg_attr(feature = "ts", derive(TS))]
2669#[cfg_attr(feature = "ts", ts(export))]
2670#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2671#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2672#[cfg_attr(feature = "serde", serde(tag = "type"))]
2673#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2674#[repr(u32)]
2675#[doc = "These values encode the bit positions of the decode position. These values can be used to read the value of a flag bit by combining the base_mode variable with AND with the flag position value. The result will be either 0 or 1, depending on if the flag is set or not."]
2676pub enum MavModeFlagDecodePosition {
2677 #[doc = "First bit: 10000000"]
2678 MAV_MODE_FLAG_DECODE_POSITION_SAFETY = 128,
2679 #[doc = "Second bit: 01000000"]
2680 MAV_MODE_FLAG_DECODE_POSITION_MANUAL = 64,
2681 #[doc = "Third bit: 00100000"]
2682 MAV_MODE_FLAG_DECODE_POSITION_HIL = 32,
2683 #[doc = "Fourth bit: 00010000"]
2684 MAV_MODE_FLAG_DECODE_POSITION_STABILIZE = 16,
2685 #[doc = "Fifth bit: 00001000"]
2686 MAV_MODE_FLAG_DECODE_POSITION_GUIDED = 8,
2687 #[doc = "Sixth bit: 00000100"]
2688 MAV_MODE_FLAG_DECODE_POSITION_AUTO = 4,
2689 #[doc = "Seventh bit: 00000010"]
2690 MAV_MODE_FLAG_DECODE_POSITION_TEST = 2,
2691 #[doc = "Eighth bit: 00000001"]
2692 MAV_MODE_FLAG_DECODE_POSITION_CUSTOM_MODE = 1,
2693}
2694impl MavModeFlagDecodePosition {
2695 pub const DEFAULT: Self = Self::MAV_MODE_FLAG_DECODE_POSITION_SAFETY;
2696}
2697impl Default for MavModeFlagDecodePosition {
2698 fn default() -> Self {
2699 Self::DEFAULT
2700 }
2701}
2702bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Mode properties."] pub struct MavModeProperty : u32 { # [doc = "If set, this mode is an advanced mode. For example a rate-controlled manual mode might be advanced, whereas a position-controlled manual mode is not. A GCS can optionally use this flag to configure the UI for its intended users."] const MAV_MODE_PROPERTY_ADVANCED = 1 ; # [doc = "If set, this mode should not be added to the list of selectable modes. The mode might still be selected by the FC directly (for example as part of a failsafe)."] const MAV_MODE_PROPERTY_NOT_USER_SELECTABLE = 2 ; # [doc = "If set, this mode is automatically controlled (it may use but does not require a manual controller). If unset the mode is a assumed to require user input (be a manual mode)."] const MAV_MODE_PROPERTY_AUTO_MODE = 4 ; } }
2703impl MavModeProperty {
2704 pub const DEFAULT: Self = Self::MAV_MODE_PROPERTY_ADVANCED;
2705}
2706impl Default for MavModeProperty {
2707 fn default() -> Self {
2708 Self::DEFAULT
2709 }
2710}
2711#[cfg_attr(feature = "ts", derive(TS))]
2712#[cfg_attr(feature = "ts", ts(export))]
2713#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2714#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2715#[cfg_attr(feature = "serde", serde(tag = "type"))]
2716#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2717#[repr(u32)]
2718#[deprecated = " See `GIMBAL_MANAGER_FLAGS` (Deprecated since 2020-01)"]
2719#[doc = "Enumeration of possible mount operation modes. This message is used by obsolete/deprecated gimbal messages."]
2720pub enum MavMountMode {
2721 #[doc = "Load and keep safe position (Roll,Pitch,Yaw) from permanent memory and stop stabilization"]
2722 MAV_MOUNT_MODE_RETRACT = 0,
2723 #[doc = "Load and keep neutral position (Roll,Pitch,Yaw) from permanent memory."]
2724 MAV_MOUNT_MODE_NEUTRAL = 1,
2725 #[doc = "Load neutral position and start MAVLink Roll,Pitch,Yaw control with stabilization"]
2726 MAV_MOUNT_MODE_MAVLINK_TARGETING = 2,
2727 #[doc = "Load neutral position and start RC Roll,Pitch,Yaw control with stabilization"]
2728 MAV_MOUNT_MODE_RC_TARGETING = 3,
2729 #[doc = "Load neutral position and start to point to Lat,Lon,Alt"]
2730 MAV_MOUNT_MODE_GPS_POINT = 4,
2731 #[doc = "Gimbal tracks system with specified system ID"]
2732 MAV_MOUNT_MODE_SYSID_TARGET = 5,
2733 #[doc = "Gimbal tracks home position"]
2734 MAV_MOUNT_MODE_HOME_LOCATION = 6,
2735}
2736impl MavMountMode {
2737 pub const DEFAULT: Self = Self::MAV_MOUNT_MODE_RETRACT;
2738}
2739impl Default for MavMountMode {
2740 fn default() -> Self {
2741 Self::DEFAULT
2742 }
2743}
2744#[cfg_attr(feature = "ts", derive(TS))]
2745#[cfg_attr(feature = "ts", ts(export))]
2746#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2747#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2748#[cfg_attr(feature = "serde", serde(tag = "type"))]
2749#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2750#[repr(u32)]
2751pub enum MavOdidArmStatus {
2752 #[doc = "Passing arming checks."]
2753 MAV_ODID_ARM_STATUS_GOOD_TO_ARM = 0,
2754 #[doc = "Generic arming failure, see error string for details."]
2755 MAV_ODID_ARM_STATUS_PRE_ARM_FAIL_GENERIC = 1,
2756}
2757impl MavOdidArmStatus {
2758 pub const DEFAULT: Self = Self::MAV_ODID_ARM_STATUS_GOOD_TO_ARM;
2759}
2760impl Default for MavOdidArmStatus {
2761 fn default() -> Self {
2762 Self::DEFAULT
2763 }
2764}
2765#[cfg_attr(feature = "ts", derive(TS))]
2766#[cfg_attr(feature = "ts", ts(export))]
2767#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2768#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2769#[cfg_attr(feature = "serde", serde(tag = "type"))]
2770#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2771#[repr(u32)]
2772pub enum MavOdidAuthType {
2773 #[doc = "No authentication type is specified."]
2774 MAV_ODID_AUTH_TYPE_NONE = 0,
2775 #[doc = "Signature for the UAS (Unmanned Aircraft System) ID."]
2776 MAV_ODID_AUTH_TYPE_UAS_ID_SIGNATURE = 1,
2777 #[doc = "Signature for the Operator ID."]
2778 MAV_ODID_AUTH_TYPE_OPERATOR_ID_SIGNATURE = 2,
2779 #[doc = "Signature for the entire message set."]
2780 MAV_ODID_AUTH_TYPE_MESSAGE_SET_SIGNATURE = 3,
2781 #[doc = "Authentication is provided by Network Remote ID."]
2782 MAV_ODID_AUTH_TYPE_NETWORK_REMOTE_ID = 4,
2783 #[doc = "The exact authentication type is indicated by the first byte of authentication_data and these type values are managed by ICAO."]
2784 MAV_ODID_AUTH_TYPE_SPECIFIC_AUTHENTICATION = 5,
2785}
2786impl MavOdidAuthType {
2787 pub const DEFAULT: Self = Self::MAV_ODID_AUTH_TYPE_NONE;
2788}
2789impl Default for MavOdidAuthType {
2790 fn default() -> Self {
2791 Self::DEFAULT
2792 }
2793}
2794#[cfg_attr(feature = "ts", derive(TS))]
2795#[cfg_attr(feature = "ts", ts(export))]
2796#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2797#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2798#[cfg_attr(feature = "serde", serde(tag = "type"))]
2799#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2800#[repr(u32)]
2801pub enum MavOdidCategoryEu {
2802 #[doc = "The category for the UA, according to the EU specification, is undeclared."]
2803 MAV_ODID_CATEGORY_EU_UNDECLARED = 0,
2804 #[doc = "The category for the UA, according to the EU specification, is the Open category."]
2805 MAV_ODID_CATEGORY_EU_OPEN = 1,
2806 #[doc = "The category for the UA, according to the EU specification, is the Specific category."]
2807 MAV_ODID_CATEGORY_EU_SPECIFIC = 2,
2808 #[doc = "The category for the UA, according to the EU specification, is the Certified category."]
2809 MAV_ODID_CATEGORY_EU_CERTIFIED = 3,
2810}
2811impl MavOdidCategoryEu {
2812 pub const DEFAULT: Self = Self::MAV_ODID_CATEGORY_EU_UNDECLARED;
2813}
2814impl Default for MavOdidCategoryEu {
2815 fn default() -> Self {
2816 Self::DEFAULT
2817 }
2818}
2819#[cfg_attr(feature = "ts", derive(TS))]
2820#[cfg_attr(feature = "ts", ts(export))]
2821#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2822#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2823#[cfg_attr(feature = "serde", serde(tag = "type"))]
2824#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2825#[repr(u32)]
2826pub enum MavOdidClassEu {
2827 #[doc = "The class for the UA, according to the EU specification, is undeclared."]
2828 MAV_ODID_CLASS_EU_UNDECLARED = 0,
2829 #[doc = "The class for the UA, according to the EU specification, is Class 0."]
2830 MAV_ODID_CLASS_EU_CLASS_0 = 1,
2831 #[doc = "The class for the UA, according to the EU specification, is Class 1."]
2832 MAV_ODID_CLASS_EU_CLASS_1 = 2,
2833 #[doc = "The class for the UA, according to the EU specification, is Class 2."]
2834 MAV_ODID_CLASS_EU_CLASS_2 = 3,
2835 #[doc = "The class for the UA, according to the EU specification, is Class 3."]
2836 MAV_ODID_CLASS_EU_CLASS_3 = 4,
2837 #[doc = "The class for the UA, according to the EU specification, is Class 4."]
2838 MAV_ODID_CLASS_EU_CLASS_4 = 5,
2839 #[doc = "The class for the UA, according to the EU specification, is Class 5."]
2840 MAV_ODID_CLASS_EU_CLASS_5 = 6,
2841 #[doc = "The class for the UA, according to the EU specification, is Class 6."]
2842 MAV_ODID_CLASS_EU_CLASS_6 = 7,
2843}
2844impl MavOdidClassEu {
2845 pub const DEFAULT: Self = Self::MAV_ODID_CLASS_EU_UNDECLARED;
2846}
2847impl Default for MavOdidClassEu {
2848 fn default() -> Self {
2849 Self::DEFAULT
2850 }
2851}
2852#[cfg_attr(feature = "ts", derive(TS))]
2853#[cfg_attr(feature = "ts", ts(export))]
2854#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2855#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2856#[cfg_attr(feature = "serde", serde(tag = "type"))]
2857#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2858#[repr(u32)]
2859pub enum MavOdidClassificationType {
2860 #[doc = "The classification type for the UA is undeclared."]
2861 MAV_ODID_CLASSIFICATION_TYPE_UNDECLARED = 0,
2862 #[doc = "The classification type for the UA follows EU (European Union) specifications."]
2863 MAV_ODID_CLASSIFICATION_TYPE_EU = 1,
2864}
2865impl MavOdidClassificationType {
2866 pub const DEFAULT: Self = Self::MAV_ODID_CLASSIFICATION_TYPE_UNDECLARED;
2867}
2868impl Default for MavOdidClassificationType {
2869 fn default() -> Self {
2870 Self::DEFAULT
2871 }
2872}
2873#[cfg_attr(feature = "ts", derive(TS))]
2874#[cfg_attr(feature = "ts", ts(export))]
2875#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2876#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2877#[cfg_attr(feature = "serde", serde(tag = "type"))]
2878#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2879#[repr(u32)]
2880pub enum MavOdidDescType {
2881 #[doc = "Optional free-form text description of the purpose of the flight."]
2882 MAV_ODID_DESC_TYPE_TEXT = 0,
2883 #[doc = "Optional additional clarification when status == MAV_ODID_STATUS_EMERGENCY."]
2884 MAV_ODID_DESC_TYPE_EMERGENCY = 1,
2885 #[doc = "Optional additional clarification when status != MAV_ODID_STATUS_EMERGENCY."]
2886 MAV_ODID_DESC_TYPE_EXTENDED_STATUS = 2,
2887}
2888impl MavOdidDescType {
2889 pub const DEFAULT: Self = Self::MAV_ODID_DESC_TYPE_TEXT;
2890}
2891impl Default for MavOdidDescType {
2892 fn default() -> Self {
2893 Self::DEFAULT
2894 }
2895}
2896#[cfg_attr(feature = "ts", derive(TS))]
2897#[cfg_attr(feature = "ts", ts(export))]
2898#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2899#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2900#[cfg_attr(feature = "serde", serde(tag = "type"))]
2901#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2902#[repr(u32)]
2903pub enum MavOdidHeightRef {
2904 #[doc = "The height field is relative to the take-off location."]
2905 MAV_ODID_HEIGHT_REF_OVER_TAKEOFF = 0,
2906 #[doc = "The height field is relative to ground."]
2907 MAV_ODID_HEIGHT_REF_OVER_GROUND = 1,
2908}
2909impl MavOdidHeightRef {
2910 pub const DEFAULT: Self = Self::MAV_ODID_HEIGHT_REF_OVER_TAKEOFF;
2911}
2912impl Default for MavOdidHeightRef {
2913 fn default() -> Self {
2914 Self::DEFAULT
2915 }
2916}
2917#[cfg_attr(feature = "ts", derive(TS))]
2918#[cfg_attr(feature = "ts", ts(export))]
2919#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2920#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2921#[cfg_attr(feature = "serde", serde(tag = "type"))]
2922#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2923#[repr(u32)]
2924pub enum MavOdidHorAcc {
2925 #[doc = "The horizontal accuracy is unknown."]
2926 MAV_ODID_HOR_ACC_UNKNOWN = 0,
2927 #[doc = "The horizontal accuracy is smaller than 10 Nautical Miles. 18.52 km."]
2928 MAV_ODID_HOR_ACC_10NM = 1,
2929 #[doc = "The horizontal accuracy is smaller than 4 Nautical Miles. 7.408 km."]
2930 MAV_ODID_HOR_ACC_4NM = 2,
2931 #[doc = "The horizontal accuracy is smaller than 2 Nautical Miles. 3.704 km."]
2932 MAV_ODID_HOR_ACC_2NM = 3,
2933 #[doc = "The horizontal accuracy is smaller than 1 Nautical Miles. 1.852 km."]
2934 MAV_ODID_HOR_ACC_1NM = 4,
2935 #[doc = "The horizontal accuracy is smaller than 0.5 Nautical Miles. 926 m."]
2936 MAV_ODID_HOR_ACC_0_5NM = 5,
2937 #[doc = "The horizontal accuracy is smaller than 0.3 Nautical Miles. 555.6 m."]
2938 MAV_ODID_HOR_ACC_0_3NM = 6,
2939 #[doc = "The horizontal accuracy is smaller than 0.1 Nautical Miles. 185.2 m."]
2940 MAV_ODID_HOR_ACC_0_1NM = 7,
2941 #[doc = "The horizontal accuracy is smaller than 0.05 Nautical Miles. 92.6 m."]
2942 MAV_ODID_HOR_ACC_0_05NM = 8,
2943 #[doc = "The horizontal accuracy is smaller than 30 meter."]
2944 MAV_ODID_HOR_ACC_30_METER = 9,
2945 #[doc = "The horizontal accuracy is smaller than 10 meter."]
2946 MAV_ODID_HOR_ACC_10_METER = 10,
2947 #[doc = "The horizontal accuracy is smaller than 3 meter."]
2948 MAV_ODID_HOR_ACC_3_METER = 11,
2949 #[doc = "The horizontal accuracy is smaller than 1 meter."]
2950 MAV_ODID_HOR_ACC_1_METER = 12,
2951}
2952impl MavOdidHorAcc {
2953 pub const DEFAULT: Self = Self::MAV_ODID_HOR_ACC_UNKNOWN;
2954}
2955impl Default for MavOdidHorAcc {
2956 fn default() -> Self {
2957 Self::DEFAULT
2958 }
2959}
2960#[cfg_attr(feature = "ts", derive(TS))]
2961#[cfg_attr(feature = "ts", ts(export))]
2962#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2963#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2964#[cfg_attr(feature = "serde", serde(tag = "type"))]
2965#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2966#[repr(u32)]
2967pub enum MavOdidIdType {
2968 #[doc = "No type defined."]
2969 MAV_ODID_ID_TYPE_NONE = 0,
2970 #[doc = "Manufacturer Serial Number (ANSI/CTA-2063 format)."]
2971 MAV_ODID_ID_TYPE_SERIAL_NUMBER = 1,
2972 #[doc = "CAA (Civil Aviation Authority) registered ID. Format: [ICAO Country Code].[CAA Assigned ID]."]
2973 MAV_ODID_ID_TYPE_CAA_REGISTRATION_ID = 2,
2974 #[doc = "UTM (Unmanned Traffic Management) assigned UUID (RFC4122)."]
2975 MAV_ODID_ID_TYPE_UTM_ASSIGNED_UUID = 3,
2976 #[doc = "A 20 byte ID for a specific flight/session. The exact ID type is indicated by the first byte of uas_id and these type values are managed by ICAO."]
2977 MAV_ODID_ID_TYPE_SPECIFIC_SESSION_ID = 4,
2978}
2979impl MavOdidIdType {
2980 pub const DEFAULT: Self = Self::MAV_ODID_ID_TYPE_NONE;
2981}
2982impl Default for MavOdidIdType {
2983 fn default() -> Self {
2984 Self::DEFAULT
2985 }
2986}
2987#[cfg_attr(feature = "ts", derive(TS))]
2988#[cfg_attr(feature = "ts", ts(export))]
2989#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2990#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2991#[cfg_attr(feature = "serde", serde(tag = "type"))]
2992#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2993#[repr(u32)]
2994pub enum MavOdidOperatorIdType {
2995 #[doc = "CAA (Civil Aviation Authority) registered operator ID."]
2996 MAV_ODID_OPERATOR_ID_TYPE_CAA = 0,
2997}
2998impl MavOdidOperatorIdType {
2999 pub const DEFAULT: Self = Self::MAV_ODID_OPERATOR_ID_TYPE_CAA;
3000}
3001impl Default for MavOdidOperatorIdType {
3002 fn default() -> Self {
3003 Self::DEFAULT
3004 }
3005}
3006#[cfg_attr(feature = "ts", derive(TS))]
3007#[cfg_attr(feature = "ts", ts(export))]
3008#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3009#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3010#[cfg_attr(feature = "serde", serde(tag = "type"))]
3011#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3012#[repr(u32)]
3013pub enum MavOdidOperatorLocationType {
3014 #[doc = "The location/altitude of the operator is the same as the take-off location."]
3015 MAV_ODID_OPERATOR_LOCATION_TYPE_TAKEOFF = 0,
3016 #[doc = "The location/altitude of the operator is dynamic. E.g. based on live GNSS data."]
3017 MAV_ODID_OPERATOR_LOCATION_TYPE_LIVE_GNSS = 1,
3018 #[doc = "The location/altitude of the operator are fixed values."]
3019 MAV_ODID_OPERATOR_LOCATION_TYPE_FIXED = 2,
3020}
3021impl MavOdidOperatorLocationType {
3022 pub const DEFAULT: Self = Self::MAV_ODID_OPERATOR_LOCATION_TYPE_TAKEOFF;
3023}
3024impl Default for MavOdidOperatorLocationType {
3025 fn default() -> Self {
3026 Self::DEFAULT
3027 }
3028}
3029#[cfg_attr(feature = "ts", derive(TS))]
3030#[cfg_attr(feature = "ts", ts(export))]
3031#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3032#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3033#[cfg_attr(feature = "serde", serde(tag = "type"))]
3034#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3035#[repr(u32)]
3036pub enum MavOdidSpeedAcc {
3037 #[doc = "The speed accuracy is unknown."]
3038 MAV_ODID_SPEED_ACC_UNKNOWN = 0,
3039 #[doc = "The speed accuracy is smaller than 10 meters per second."]
3040 MAV_ODID_SPEED_ACC_10_METERS_PER_SECOND = 1,
3041 #[doc = "The speed accuracy is smaller than 3 meters per second."]
3042 MAV_ODID_SPEED_ACC_3_METERS_PER_SECOND = 2,
3043 #[doc = "The speed accuracy is smaller than 1 meters per second."]
3044 MAV_ODID_SPEED_ACC_1_METERS_PER_SECOND = 3,
3045 #[doc = "The speed accuracy is smaller than 0.3 meters per second."]
3046 MAV_ODID_SPEED_ACC_0_3_METERS_PER_SECOND = 4,
3047}
3048impl MavOdidSpeedAcc {
3049 pub const DEFAULT: Self = Self::MAV_ODID_SPEED_ACC_UNKNOWN;
3050}
3051impl Default for MavOdidSpeedAcc {
3052 fn default() -> Self {
3053 Self::DEFAULT
3054 }
3055}
3056#[cfg_attr(feature = "ts", derive(TS))]
3057#[cfg_attr(feature = "ts", ts(export))]
3058#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3059#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3060#[cfg_attr(feature = "serde", serde(tag = "type"))]
3061#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3062#[repr(u32)]
3063pub enum MavOdidStatus {
3064 #[doc = "The status of the (UA) Unmanned Aircraft is undefined."]
3065 MAV_ODID_STATUS_UNDECLARED = 0,
3066 #[doc = "The UA is on the ground."]
3067 MAV_ODID_STATUS_GROUND = 1,
3068 #[doc = "The UA is in the air."]
3069 MAV_ODID_STATUS_AIRBORNE = 2,
3070 #[doc = "The UA is having an emergency."]
3071 MAV_ODID_STATUS_EMERGENCY = 3,
3072 #[doc = "The remote ID system is failing or unreliable in some way."]
3073 MAV_ODID_STATUS_REMOTE_ID_SYSTEM_FAILURE = 4,
3074}
3075impl MavOdidStatus {
3076 pub const DEFAULT: Self = Self::MAV_ODID_STATUS_UNDECLARED;
3077}
3078impl Default for MavOdidStatus {
3079 fn default() -> Self {
3080 Self::DEFAULT
3081 }
3082}
3083#[cfg_attr(feature = "ts", derive(TS))]
3084#[cfg_attr(feature = "ts", ts(export))]
3085#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3086#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3087#[cfg_attr(feature = "serde", serde(tag = "type"))]
3088#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3089#[repr(u32)]
3090pub enum MavOdidTimeAcc {
3091 #[doc = "The timestamp accuracy is unknown."]
3092 MAV_ODID_TIME_ACC_UNKNOWN = 0,
3093 #[doc = "The timestamp accuracy is smaller than or equal to 0.1 second."]
3094 MAV_ODID_TIME_ACC_0_1_SECOND = 1,
3095 #[doc = "The timestamp accuracy is smaller than or equal to 0.2 second."]
3096 MAV_ODID_TIME_ACC_0_2_SECOND = 2,
3097 #[doc = "The timestamp accuracy is smaller than or equal to 0.3 second."]
3098 MAV_ODID_TIME_ACC_0_3_SECOND = 3,
3099 #[doc = "The timestamp accuracy is smaller than or equal to 0.4 second."]
3100 MAV_ODID_TIME_ACC_0_4_SECOND = 4,
3101 #[doc = "The timestamp accuracy is smaller than or equal to 0.5 second."]
3102 MAV_ODID_TIME_ACC_0_5_SECOND = 5,
3103 #[doc = "The timestamp accuracy is smaller than or equal to 0.6 second."]
3104 MAV_ODID_TIME_ACC_0_6_SECOND = 6,
3105 #[doc = "The timestamp accuracy is smaller than or equal to 0.7 second."]
3106 MAV_ODID_TIME_ACC_0_7_SECOND = 7,
3107 #[doc = "The timestamp accuracy is smaller than or equal to 0.8 second."]
3108 MAV_ODID_TIME_ACC_0_8_SECOND = 8,
3109 #[doc = "The timestamp accuracy is smaller than or equal to 0.9 second."]
3110 MAV_ODID_TIME_ACC_0_9_SECOND = 9,
3111 #[doc = "The timestamp accuracy is smaller than or equal to 1.0 second."]
3112 MAV_ODID_TIME_ACC_1_0_SECOND = 10,
3113 #[doc = "The timestamp accuracy is smaller than or equal to 1.1 second."]
3114 MAV_ODID_TIME_ACC_1_1_SECOND = 11,
3115 #[doc = "The timestamp accuracy is smaller than or equal to 1.2 second."]
3116 MAV_ODID_TIME_ACC_1_2_SECOND = 12,
3117 #[doc = "The timestamp accuracy is smaller than or equal to 1.3 second."]
3118 MAV_ODID_TIME_ACC_1_3_SECOND = 13,
3119 #[doc = "The timestamp accuracy is smaller than or equal to 1.4 second."]
3120 MAV_ODID_TIME_ACC_1_4_SECOND = 14,
3121 #[doc = "The timestamp accuracy is smaller than or equal to 1.5 second."]
3122 MAV_ODID_TIME_ACC_1_5_SECOND = 15,
3123}
3124impl MavOdidTimeAcc {
3125 pub const DEFAULT: Self = Self::MAV_ODID_TIME_ACC_UNKNOWN;
3126}
3127impl Default for MavOdidTimeAcc {
3128 fn default() -> Self {
3129 Self::DEFAULT
3130 }
3131}
3132#[cfg_attr(feature = "ts", derive(TS))]
3133#[cfg_attr(feature = "ts", ts(export))]
3134#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3135#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3136#[cfg_attr(feature = "serde", serde(tag = "type"))]
3137#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3138#[repr(u32)]
3139pub enum MavOdidUaType {
3140 #[doc = "No UA (Unmanned Aircraft) type defined."]
3141 MAV_ODID_UA_TYPE_NONE = 0,
3142 #[doc = "Aeroplane/Airplane. Fixed wing."]
3143 MAV_ODID_UA_TYPE_AEROPLANE = 1,
3144 #[doc = "Helicopter or multirotor."]
3145 MAV_ODID_UA_TYPE_HELICOPTER_OR_MULTIROTOR = 2,
3146 #[doc = "Gyroplane."]
3147 MAV_ODID_UA_TYPE_GYROPLANE = 3,
3148 #[doc = "VTOL (Vertical Take-Off and Landing). Fixed wing aircraft that can take off vertically."]
3149 MAV_ODID_UA_TYPE_HYBRID_LIFT = 4,
3150 #[doc = "Ornithopter."]
3151 MAV_ODID_UA_TYPE_ORNITHOPTER = 5,
3152 #[doc = "Glider."]
3153 MAV_ODID_UA_TYPE_GLIDER = 6,
3154 #[doc = "Kite."]
3155 MAV_ODID_UA_TYPE_KITE = 7,
3156 #[doc = "Free Balloon."]
3157 MAV_ODID_UA_TYPE_FREE_BALLOON = 8,
3158 #[doc = "Captive Balloon."]
3159 MAV_ODID_UA_TYPE_CAPTIVE_BALLOON = 9,
3160 #[doc = "Airship. E.g. a blimp."]
3161 MAV_ODID_UA_TYPE_AIRSHIP = 10,
3162 #[doc = "Free Fall/Parachute (unpowered)."]
3163 MAV_ODID_UA_TYPE_FREE_FALL_PARACHUTE = 11,
3164 #[doc = "Rocket."]
3165 MAV_ODID_UA_TYPE_ROCKET = 12,
3166 #[doc = "Tethered powered aircraft."]
3167 MAV_ODID_UA_TYPE_TETHERED_POWERED_AIRCRAFT = 13,
3168 #[doc = "Ground Obstacle."]
3169 MAV_ODID_UA_TYPE_GROUND_OBSTACLE = 14,
3170 #[doc = "Other type of aircraft not listed earlier."]
3171 MAV_ODID_UA_TYPE_OTHER = 15,
3172}
3173impl MavOdidUaType {
3174 pub const DEFAULT: Self = Self::MAV_ODID_UA_TYPE_NONE;
3175}
3176impl Default for MavOdidUaType {
3177 fn default() -> Self {
3178 Self::DEFAULT
3179 }
3180}
3181#[cfg_attr(feature = "ts", derive(TS))]
3182#[cfg_attr(feature = "ts", ts(export))]
3183#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3184#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3185#[cfg_attr(feature = "serde", serde(tag = "type"))]
3186#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3187#[repr(u32)]
3188pub enum MavOdidVerAcc {
3189 #[doc = "The vertical accuracy is unknown."]
3190 MAV_ODID_VER_ACC_UNKNOWN = 0,
3191 #[doc = "The vertical accuracy is smaller than 150 meter."]
3192 MAV_ODID_VER_ACC_150_METER = 1,
3193 #[doc = "The vertical accuracy is smaller than 45 meter."]
3194 MAV_ODID_VER_ACC_45_METER = 2,
3195 #[doc = "The vertical accuracy is smaller than 25 meter."]
3196 MAV_ODID_VER_ACC_25_METER = 3,
3197 #[doc = "The vertical accuracy is smaller than 10 meter."]
3198 MAV_ODID_VER_ACC_10_METER = 4,
3199 #[doc = "The vertical accuracy is smaller than 3 meter."]
3200 MAV_ODID_VER_ACC_3_METER = 5,
3201 #[doc = "The vertical accuracy is smaller than 1 meter."]
3202 MAV_ODID_VER_ACC_1_METER = 6,
3203}
3204impl MavOdidVerAcc {
3205 pub const DEFAULT: Self = Self::MAV_ODID_VER_ACC_UNKNOWN;
3206}
3207impl Default for MavOdidVerAcc {
3208 fn default() -> Self {
3209 Self::DEFAULT
3210 }
3211}
3212#[cfg_attr(feature = "ts", derive(TS))]
3213#[cfg_attr(feature = "ts", ts(export))]
3214#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3215#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3216#[cfg_attr(feature = "serde", serde(tag = "type"))]
3217#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3218#[repr(u32)]
3219#[doc = "Specifies the datatype of a MAVLink extended parameter."]
3220pub enum MavParamExtType {
3221 #[doc = "8-bit unsigned integer"]
3222 MAV_PARAM_EXT_TYPE_UINT8 = 1,
3223 #[doc = "8-bit signed integer"]
3224 MAV_PARAM_EXT_TYPE_INT8 = 2,
3225 #[doc = "16-bit unsigned integer"]
3226 MAV_PARAM_EXT_TYPE_UINT16 = 3,
3227 #[doc = "16-bit signed integer"]
3228 MAV_PARAM_EXT_TYPE_INT16 = 4,
3229 #[doc = "32-bit unsigned integer"]
3230 MAV_PARAM_EXT_TYPE_UINT32 = 5,
3231 #[doc = "32-bit signed integer"]
3232 MAV_PARAM_EXT_TYPE_INT32 = 6,
3233 #[doc = "64-bit unsigned integer"]
3234 MAV_PARAM_EXT_TYPE_UINT64 = 7,
3235 #[doc = "64-bit signed integer"]
3236 MAV_PARAM_EXT_TYPE_INT64 = 8,
3237 #[doc = "32-bit floating-point"]
3238 MAV_PARAM_EXT_TYPE_REAL32 = 9,
3239 #[doc = "64-bit floating-point"]
3240 MAV_PARAM_EXT_TYPE_REAL64 = 10,
3241 #[doc = "Custom Type"]
3242 MAV_PARAM_EXT_TYPE_CUSTOM = 11,
3243}
3244impl MavParamExtType {
3245 pub const DEFAULT: Self = Self::MAV_PARAM_EXT_TYPE_UINT8;
3246}
3247impl Default for MavParamExtType {
3248 fn default() -> Self {
3249 Self::DEFAULT
3250 }
3251}
3252#[cfg_attr(feature = "ts", derive(TS))]
3253#[cfg_attr(feature = "ts", ts(export))]
3254#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3255#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3256#[cfg_attr(feature = "serde", serde(tag = "type"))]
3257#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3258#[repr(u32)]
3259#[doc = "Specifies the datatype of a MAVLink parameter."]
3260pub enum MavParamType {
3261 #[doc = "8-bit unsigned integer"]
3262 MAV_PARAM_TYPE_UINT8 = 1,
3263 #[doc = "8-bit signed integer"]
3264 MAV_PARAM_TYPE_INT8 = 2,
3265 #[doc = "16-bit unsigned integer"]
3266 MAV_PARAM_TYPE_UINT16 = 3,
3267 #[doc = "16-bit signed integer"]
3268 MAV_PARAM_TYPE_INT16 = 4,
3269 #[doc = "32-bit unsigned integer"]
3270 MAV_PARAM_TYPE_UINT32 = 5,
3271 #[doc = "32-bit signed integer"]
3272 MAV_PARAM_TYPE_INT32 = 6,
3273 #[doc = "64-bit unsigned integer"]
3274 MAV_PARAM_TYPE_UINT64 = 7,
3275 #[doc = "64-bit signed integer"]
3276 MAV_PARAM_TYPE_INT64 = 8,
3277 #[doc = "32-bit floating-point"]
3278 MAV_PARAM_TYPE_REAL32 = 9,
3279 #[doc = "64-bit floating-point"]
3280 MAV_PARAM_TYPE_REAL64 = 10,
3281}
3282impl MavParamType {
3283 pub const DEFAULT: Self = Self::MAV_PARAM_TYPE_UINT8;
3284}
3285impl Default for MavParamType {
3286 fn default() -> Self {
3287 Self::DEFAULT
3288 }
3289}
3290bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Power supply status flags (bitmask)"] pub struct MavPowerStatus : u16 { # [doc = "main brick power supply valid"] const MAV_POWER_STATUS_BRICK_VALID = 1 ; # [doc = "main servo power supply valid for FMU"] const MAV_POWER_STATUS_SERVO_VALID = 2 ; # [doc = "USB power is connected"] const MAV_POWER_STATUS_USB_CONNECTED = 4 ; # [doc = "peripheral supply is in over-current state"] const MAV_POWER_STATUS_PERIPH_OVERCURRENT = 8 ; # [doc = "hi-power peripheral supply is in over-current state"] const MAV_POWER_STATUS_PERIPH_HIPOWER_OVERCURRENT = 16 ; # [doc = "Power status has changed since boot"] const MAV_POWER_STATUS_CHANGED = 32 ; } }
3291impl MavPowerStatus {
3292 pub const DEFAULT: Self = Self::MAV_POWER_STATUS_BRICK_VALID;
3293}
3294impl Default for MavPowerStatus {
3295 fn default() -> Self {
3296 Self::DEFAULT
3297 }
3298}
3299bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmask of (optional) autopilot capabilities (64 bit). If a bit is set, the autopilot supports this capability."] pub struct MavProtocolCapability : u64 { # [doc = "Autopilot supports the MISSION_ITEM float message type. Note that MISSION_ITEM is deprecated, and autopilots should use MISSION_INT instead."] const MAV_PROTOCOL_CAPABILITY_MISSION_FLOAT = 1 ; # [deprecated = " See `MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST` (Deprecated since 2022-03)"] # [doc = "Autopilot supports the new param float message type."] const MAV_PROTOCOL_CAPABILITY_PARAM_FLOAT = 2 ; # [doc = "Autopilot supports MISSION_ITEM_INT scaled integer message type. Note that this flag must always be set if missions are supported, because missions must always use MISSION_ITEM_INT (rather than MISSION_ITEM, which is deprecated)."] const MAV_PROTOCOL_CAPABILITY_MISSION_INT = 4 ; # [doc = "Autopilot supports COMMAND_INT scaled integer message type."] const MAV_PROTOCOL_CAPABILITY_COMMAND_INT = 8 ; # [doc = "Parameter protocol uses byte-wise encoding of parameter values into param_value (float) fields: <https://mavlink.io/en/services/parameter.html#parameter-encoding>. Note that either this flag or MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST should be set if the parameter protocol is supported."] const MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_BYTEWISE = 16 ; # [doc = "Autopilot supports the File Transfer Protocol v1: <https://mavlink.io/en/services/ftp.html>."] const MAV_PROTOCOL_CAPABILITY_FTP = 32 ; # [doc = "Autopilot supports commanding attitude offboard."] const MAV_PROTOCOL_CAPABILITY_SET_ATTITUDE_TARGET = 64 ; # [doc = "Autopilot supports commanding position and velocity targets in local NED frame."] const MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_LOCAL_NED = 128 ; # [doc = "Autopilot supports commanding position and velocity targets in global scaled integers."] const MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_GLOBAL_INT = 256 ; # [doc = "Autopilot supports terrain protocol / data handling."] const MAV_PROTOCOL_CAPABILITY_TERRAIN = 512 ; # [doc = "Reserved for future use."] const MAV_PROTOCOL_CAPABILITY_RESERVED3 = 1024 ; # [doc = "Autopilot supports the MAV_CMD_DO_FLIGHTTERMINATION command (flight termination)."] const MAV_PROTOCOL_CAPABILITY_FLIGHT_TERMINATION = 2048 ; # [doc = "Autopilot supports onboard compass calibration."] const MAV_PROTOCOL_CAPABILITY_COMPASS_CALIBRATION = 4096 ; # [doc = "Autopilot supports MAVLink version 2."] const MAV_PROTOCOL_CAPABILITY_MAVLINK2 = 8192 ; # [doc = "Autopilot supports mission fence protocol."] const MAV_PROTOCOL_CAPABILITY_MISSION_FENCE = 16384 ; # [doc = "Autopilot supports mission rally point protocol."] const MAV_PROTOCOL_CAPABILITY_MISSION_RALLY = 32768 ; # [doc = "Reserved for future use."] const MAV_PROTOCOL_CAPABILITY_RESERVED2 = 65536 ; # [doc = "Parameter protocol uses C-cast of parameter values to set the param_value (float) fields: <https://mavlink.io/en/services/parameter.html#parameter-encoding>. Note that either this flag or MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_BYTEWISE should be set if the parameter protocol is supported."] const MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST = 131072 ; # [doc = "This component implements/is a gimbal manager. This means the GIMBAL_MANAGER_INFORMATION, and other messages can be requested."] const MAV_PROTOCOL_CAPABILITY_COMPONENT_IMPLEMENTS_GIMBAL_MANAGER = 262144 ; # [doc = "Component supports locking control to a particular GCS independent of its system (via MAV_CMD_REQUEST_OPERATOR_CONTROL)."] const MAV_PROTOCOL_CAPABILITY_COMPONENT_ACCEPTS_GCS_CONTROL = 524288 ; } }
3300impl MavProtocolCapability {
3301 pub const DEFAULT: Self = Self::MAV_PROTOCOL_CAPABILITY_MISSION_FLOAT;
3302}
3303impl Default for MavProtocolCapability {
3304 fn default() -> Self {
3305 Self::DEFAULT
3306 }
3307}
3308#[cfg_attr(feature = "ts", derive(TS))]
3309#[cfg_attr(feature = "ts", ts(export))]
3310#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3311#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3312#[cfg_attr(feature = "serde", serde(tag = "type"))]
3313#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3314#[repr(u32)]
3315#[doc = "Result from a MAVLink command (MAV_CMD)"]
3316pub enum MavResult {
3317 #[doc = "Command is valid (is supported and has valid parameters), and was executed."]
3318 MAV_RESULT_ACCEPTED = 0,
3319 #[doc = "Command is valid, but cannot be executed at this time. This is used to indicate a problem that should be fixed just by waiting (e.g. a state machine is busy, can't arm because have not got GPS lock, etc.). Retrying later should work."]
3320 MAV_RESULT_TEMPORARILY_REJECTED = 1,
3321 #[doc = "Command is invalid (is supported but has invalid parameters). Retrying same command and parameters will not work."]
3322 MAV_RESULT_DENIED = 2,
3323 #[doc = "Command is not supported (unknown)."]
3324 MAV_RESULT_UNSUPPORTED = 3,
3325 #[doc = "Command is valid, but execution has failed. This is used to indicate any non-temporary or unexpected problem, i.e. any problem that must be fixed before the command can succeed/be retried. For example, attempting to write a file when out of memory, attempting to arm when sensors are not calibrated, etc."]
3326 MAV_RESULT_FAILED = 4,
3327 #[doc = "Command is valid and is being executed. This will be followed by further progress updates, i.e. the component may send further COMMAND_ACK messages with result MAV_RESULT_IN_PROGRESS (at a rate decided by the implementation), and must terminate by sending a COMMAND_ACK message with final result of the operation. The COMMAND_ACK.progress field can be used to indicate the progress of the operation."]
3328 MAV_RESULT_IN_PROGRESS = 5,
3329 #[doc = "Command has been cancelled (as a result of receiving a COMMAND_CANCEL message)."]
3330 MAV_RESULT_CANCELLED = 6,
3331 #[doc = "Command is only accepted when sent as a COMMAND_LONG."]
3332 MAV_RESULT_COMMAND_LONG_ONLY = 7,
3333 #[doc = "Command is only accepted when sent as a COMMAND_INT."]
3334 MAV_RESULT_COMMAND_INT_ONLY = 8,
3335 #[doc = "Command is invalid because a frame is required and the specified frame is not supported."]
3336 MAV_RESULT_COMMAND_UNSUPPORTED_MAV_FRAME = 9,
3337}
3338impl MavResult {
3339 pub const DEFAULT: Self = Self::MAV_RESULT_ACCEPTED;
3340}
3341impl Default for MavResult {
3342 fn default() -> Self {
3343 Self::DEFAULT
3344 }
3345}
3346#[cfg_attr(feature = "ts", derive(TS))]
3347#[cfg_attr(feature = "ts", ts(export))]
3348#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3349#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3350#[cfg_attr(feature = "serde", serde(tag = "type"))]
3351#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3352#[repr(u32)]
3353#[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
3354#[doc = "The ROI (region of interest) for the vehicle. This can be be used by the vehicle for camera/vehicle attitude alignment (see MAV_CMD_NAV_ROI)."]
3355pub enum MavRoi {
3356 #[doc = "No region of interest."]
3357 MAV_ROI_NONE = 0,
3358 #[doc = "Point toward next waypoint, with optional pitch/roll/yaw offset."]
3359 MAV_ROI_WPNEXT = 1,
3360 #[doc = "Point toward given waypoint."]
3361 MAV_ROI_WPINDEX = 2,
3362 #[doc = "Point toward fixed location."]
3363 MAV_ROI_LOCATION = 3,
3364 #[doc = "Point toward of given id."]
3365 MAV_ROI_TARGET = 4,
3366}
3367impl MavRoi {
3368 pub const DEFAULT: Self = Self::MAV_ROI_NONE;
3369}
3370impl Default for MavRoi {
3371 fn default() -> Self {
3372 Self::DEFAULT
3373 }
3374}
3375#[cfg_attr(feature = "ts", derive(TS))]
3376#[cfg_attr(feature = "ts", ts(export))]
3377#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3378#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3379#[cfg_attr(feature = "serde", serde(tag = "type"))]
3380#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3381#[repr(u32)]
3382#[doc = "Enumeration of sensor orientation, according to its rotations"]
3383pub enum MavSensorOrientation {
3384 #[doc = "Roll: 0, Pitch: 0, Yaw: 0"]
3385 MAV_SENSOR_ROTATION_NONE = 0,
3386 #[doc = "Roll: 0, Pitch: 0, Yaw: 45"]
3387 MAV_SENSOR_ROTATION_YAW_45 = 1,
3388 #[doc = "Roll: 0, Pitch: 0, Yaw: 90"]
3389 MAV_SENSOR_ROTATION_YAW_90 = 2,
3390 #[doc = "Roll: 0, Pitch: 0, Yaw: 135"]
3391 MAV_SENSOR_ROTATION_YAW_135 = 3,
3392 #[doc = "Roll: 0, Pitch: 0, Yaw: 180"]
3393 MAV_SENSOR_ROTATION_YAW_180 = 4,
3394 #[doc = "Roll: 0, Pitch: 0, Yaw: 225"]
3395 MAV_SENSOR_ROTATION_YAW_225 = 5,
3396 #[doc = "Roll: 0, Pitch: 0, Yaw: 270"]
3397 MAV_SENSOR_ROTATION_YAW_270 = 6,
3398 #[doc = "Roll: 0, Pitch: 0, Yaw: 315"]
3399 MAV_SENSOR_ROTATION_YAW_315 = 7,
3400 #[doc = "Roll: 180, Pitch: 0, Yaw: 0"]
3401 MAV_SENSOR_ROTATION_ROLL_180 = 8,
3402 #[doc = "Roll: 180, Pitch: 0, Yaw: 45"]
3403 MAV_SENSOR_ROTATION_ROLL_180_YAW_45 = 9,
3404 #[doc = "Roll: 180, Pitch: 0, Yaw: 90"]
3405 MAV_SENSOR_ROTATION_ROLL_180_YAW_90 = 10,
3406 #[doc = "Roll: 180, Pitch: 0, Yaw: 135"]
3407 MAV_SENSOR_ROTATION_ROLL_180_YAW_135 = 11,
3408 #[doc = "Roll: 0, Pitch: 180, Yaw: 0"]
3409 MAV_SENSOR_ROTATION_PITCH_180 = 12,
3410 #[doc = "Roll: 180, Pitch: 0, Yaw: 225"]
3411 MAV_SENSOR_ROTATION_ROLL_180_YAW_225 = 13,
3412 #[doc = "Roll: 180, Pitch: 0, Yaw: 270"]
3413 MAV_SENSOR_ROTATION_ROLL_180_YAW_270 = 14,
3414 #[doc = "Roll: 180, Pitch: 0, Yaw: 315"]
3415 MAV_SENSOR_ROTATION_ROLL_180_YAW_315 = 15,
3416 #[doc = "Roll: 90, Pitch: 0, Yaw: 0"]
3417 MAV_SENSOR_ROTATION_ROLL_90 = 16,
3418 #[doc = "Roll: 90, Pitch: 0, Yaw: 45"]
3419 MAV_SENSOR_ROTATION_ROLL_90_YAW_45 = 17,
3420 #[doc = "Roll: 90, Pitch: 0, Yaw: 90"]
3421 MAV_SENSOR_ROTATION_ROLL_90_YAW_90 = 18,
3422 #[doc = "Roll: 90, Pitch: 0, Yaw: 135"]
3423 MAV_SENSOR_ROTATION_ROLL_90_YAW_135 = 19,
3424 #[doc = "Roll: 270, Pitch: 0, Yaw: 0"]
3425 MAV_SENSOR_ROTATION_ROLL_270 = 20,
3426 #[doc = "Roll: 270, Pitch: 0, Yaw: 45"]
3427 MAV_SENSOR_ROTATION_ROLL_270_YAW_45 = 21,
3428 #[doc = "Roll: 270, Pitch: 0, Yaw: 90"]
3429 MAV_SENSOR_ROTATION_ROLL_270_YAW_90 = 22,
3430 #[doc = "Roll: 270, Pitch: 0, Yaw: 135"]
3431 MAV_SENSOR_ROTATION_ROLL_270_YAW_135 = 23,
3432 #[doc = "Roll: 0, Pitch: 90, Yaw: 0"]
3433 MAV_SENSOR_ROTATION_PITCH_90 = 24,
3434 #[doc = "Roll: 0, Pitch: 270, Yaw: 0"]
3435 MAV_SENSOR_ROTATION_PITCH_270 = 25,
3436 #[doc = "Roll: 0, Pitch: 180, Yaw: 90"]
3437 MAV_SENSOR_ROTATION_PITCH_180_YAW_90 = 26,
3438 #[doc = "Roll: 0, Pitch: 180, Yaw: 270"]
3439 MAV_SENSOR_ROTATION_PITCH_180_YAW_270 = 27,
3440 #[doc = "Roll: 90, Pitch: 90, Yaw: 0"]
3441 MAV_SENSOR_ROTATION_ROLL_90_PITCH_90 = 28,
3442 #[doc = "Roll: 180, Pitch: 90, Yaw: 0"]
3443 MAV_SENSOR_ROTATION_ROLL_180_PITCH_90 = 29,
3444 #[doc = "Roll: 270, Pitch: 90, Yaw: 0"]
3445 MAV_SENSOR_ROTATION_ROLL_270_PITCH_90 = 30,
3446 #[doc = "Roll: 90, Pitch: 180, Yaw: 0"]
3447 MAV_SENSOR_ROTATION_ROLL_90_PITCH_180 = 31,
3448 #[doc = "Roll: 270, Pitch: 180, Yaw: 0"]
3449 MAV_SENSOR_ROTATION_ROLL_270_PITCH_180 = 32,
3450 #[doc = "Roll: 90, Pitch: 270, Yaw: 0"]
3451 MAV_SENSOR_ROTATION_ROLL_90_PITCH_270 = 33,
3452 #[doc = "Roll: 180, Pitch: 270, Yaw: 0"]
3453 MAV_SENSOR_ROTATION_ROLL_180_PITCH_270 = 34,
3454 #[doc = "Roll: 270, Pitch: 270, Yaw: 0"]
3455 MAV_SENSOR_ROTATION_ROLL_270_PITCH_270 = 35,
3456 #[doc = "Roll: 90, Pitch: 180, Yaw: 90"]
3457 MAV_SENSOR_ROTATION_ROLL_90_PITCH_180_YAW_90 = 36,
3458 #[doc = "Roll: 90, Pitch: 0, Yaw: 270"]
3459 MAV_SENSOR_ROTATION_ROLL_90_YAW_270 = 37,
3460 #[doc = "Roll: 90, Pitch: 68, Yaw: 293"]
3461 MAV_SENSOR_ROTATION_ROLL_90_PITCH_68_YAW_293 = 38,
3462 #[doc = "Pitch: 315"]
3463 MAV_SENSOR_ROTATION_PITCH_315 = 39,
3464 #[doc = "Roll: 90, Pitch: 315"]
3465 MAV_SENSOR_ROTATION_ROLL_90_PITCH_315 = 40,
3466 #[doc = "Custom orientation"]
3467 MAV_SENSOR_ROTATION_CUSTOM = 100,
3468}
3469impl MavSensorOrientation {
3470 pub const DEFAULT: Self = Self::MAV_SENSOR_ROTATION_NONE;
3471}
3472impl Default for MavSensorOrientation {
3473 fn default() -> Self {
3474 Self::DEFAULT
3475 }
3476}
3477#[cfg_attr(feature = "ts", derive(TS))]
3478#[cfg_attr(feature = "ts", ts(export))]
3479#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3480#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3481#[cfg_attr(feature = "serde", serde(tag = "type"))]
3482#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3483#[repr(u32)]
3484#[doc = "Indicates the severity level, generally used for status messages to indicate their relative urgency. Based on RFC-5424 using expanded definitions at: <http://www.kiwisyslog.com/kb/info:-syslog-message-levels/>."]
3485pub enum MavSeverity {
3486 #[doc = "System is unusable. This is a \"panic\" condition."]
3487 MAV_SEVERITY_EMERGENCY = 0,
3488 #[doc = "Action should be taken immediately. Indicates error in non-critical systems."]
3489 MAV_SEVERITY_ALERT = 1,
3490 #[doc = "Action must be taken immediately. Indicates failure in a primary system."]
3491 MAV_SEVERITY_CRITICAL = 2,
3492 #[doc = "Indicates an error in secondary/redundant systems."]
3493 MAV_SEVERITY_ERROR = 3,
3494 #[doc = "Indicates about a possible future error if this is not resolved within a given timeframe. Example would be a low battery warning."]
3495 MAV_SEVERITY_WARNING = 4,
3496 #[doc = "An unusual event has occurred, though not an error condition. This should be investigated for the root cause."]
3497 MAV_SEVERITY_NOTICE = 5,
3498 #[doc = "Normal operational messages. Useful for logging. No action is required for these messages."]
3499 MAV_SEVERITY_INFO = 6,
3500 #[doc = "Useful non-operational messages that can assist in debugging. These should not occur during normal operation."]
3501 MAV_SEVERITY_DEBUG = 7,
3502}
3503impl MavSeverity {
3504 pub const DEFAULT: Self = Self::MAV_SEVERITY_EMERGENCY;
3505}
3506impl Default for MavSeverity {
3507 fn default() -> Self {
3508 Self::DEFAULT
3509 }
3510}
3511#[cfg_attr(feature = "ts", derive(TS))]
3512#[cfg_attr(feature = "ts", ts(export))]
3513#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3514#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3515#[cfg_attr(feature = "serde", serde(tag = "type"))]
3516#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3517#[repr(u32)]
3518#[doc = "Standard modes with a well understood meaning across flight stacks and vehicle types. For example, most flight stack have the concept of a \"return\" or \"RTL\" mode that takes a vehicle to safety, even though the precise mechanics of this mode may differ. The modes supported by a flight stack can be queried using AVAILABLE_MODES and set using MAV_CMD_DO_SET_STANDARD_MODE. The current mode is streamed in CURRENT_MODE. See <https://mavlink.io/en/services/standard_modes.html>"]
3519pub enum MavStandardMode {
3520 #[doc = "Non standard mode. This may be used when reporting the mode if the current flight mode is not a standard mode."]
3521 MAV_STANDARD_MODE_NON_STANDARD = 0,
3522 #[doc = "Position mode (manual). Position-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold both position and altitude against wind and external forces. This mode can only be set by vehicles that can hold a fixed position. Multicopter (MC) vehicles actively brake and hold both position and altitude against wind and external forces. Hybrid MC/FW (\"VTOL\") vehicles first transition to multicopter mode (if needed) but otherwise behave in the same way as MC vehicles. Fixed-wing (FW) vehicles must not support this mode. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3523 MAV_STANDARD_MODE_POSITION_HOLD = 1,
3524 #[doc = "Orbit (manual). Position-controlled and stabilized manual mode. The vehicle circles around a fixed setpoint in the horizontal plane at a particular radius, altitude, and direction. Flight stacks may further allow manual control over the setpoint position, radius, direction, speed, and/or altitude of the circle, but this is not mandated. Flight stacks may support the [MAV_CMD_DO_ORBIT](<https://mavlink.io/en/messages/common.html#MAV_CMD_DO_ORBIT>) for changing the orbit parameters. MC and FW vehicles may support this mode. Hybrid MC/FW (\"VTOL\") vehicles may support this mode in MC/FW or both modes; if the mode is not supported by the current configuration the vehicle should transition to the supported configuration. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3525 MAV_STANDARD_MODE_ORBIT = 2,
3526 #[doc = "Cruise mode (manual). Position-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold their original track against wind and external forces. Fixed-wing (FW) vehicles level orientation and maintain current track and altitude against wind and external forces. Hybrid MC/FW (\"VTOL\") vehicles first transition to FW mode (if needed) but otherwise behave in the same way as MC vehicles. Multicopter (MC) vehicles must not support this mode. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3527 MAV_STANDARD_MODE_CRUISE = 3,
3528 #[doc = "Altitude hold (manual). Altitude-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold their altitude. MC vehicles continue with existing momentum and may move with wind (or other external forces). FW vehicles continue with current heading, but may be moved off-track by wind. Hybrid MC/FW (\"VTOL\") vehicles behave according to their current configuration/mode (FW or MC). Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3529 MAV_STANDARD_MODE_ALTITUDE_HOLD = 4,
3530 #[doc = "Safe recovery mode (auto). Automatic mode that takes vehicle to a predefined safe location via a safe flight path, and may also automatically land the vehicle. This mode is more commonly referred to as RTL and/or or Smart RTL. The precise return location, flight path, and landing behaviour depend on vehicle configuration and type. For example, the vehicle might return to the home/launch location, a rally point, or the start of a mission landing, it might follow a direct path, mission path, or breadcrumb path, and land using a mission landing pattern or some other kind of descent."]
3531 MAV_STANDARD_MODE_SAFE_RECOVERY = 5,
3532 #[doc = "Mission mode (automatic). Automatic mode that executes MAVLink missions. Missions are executed from the current waypoint as soon as the mode is enabled."]
3533 MAV_STANDARD_MODE_MISSION = 6,
3534 #[doc = "Land mode (auto). Automatic mode that lands the vehicle at the current location. The precise landing behaviour depends on vehicle configuration and type."]
3535 MAV_STANDARD_MODE_LAND = 7,
3536 #[doc = "Takeoff mode (auto). Automatic takeoff mode. The precise takeoff behaviour depends on vehicle configuration and type."]
3537 MAV_STANDARD_MODE_TAKEOFF = 8,
3538}
3539impl MavStandardMode {
3540 pub const DEFAULT: Self = Self::MAV_STANDARD_MODE_NON_STANDARD;
3541}
3542impl Default for MavStandardMode {
3543 fn default() -> Self {
3544 Self::DEFAULT
3545 }
3546}
3547#[cfg_attr(feature = "ts", derive(TS))]
3548#[cfg_attr(feature = "ts", ts(export))]
3549#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3550#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3551#[cfg_attr(feature = "serde", serde(tag = "type"))]
3552#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3553#[repr(u32)]
3554pub enum MavState {
3555 #[doc = "Uninitialized system, state is unknown."]
3556 MAV_STATE_UNINIT = 0,
3557 #[doc = "System is booting up."]
3558 MAV_STATE_BOOT = 1,
3559 #[doc = "System is calibrating and not flight-ready."]
3560 MAV_STATE_CALIBRATING = 2,
3561 #[doc = "System is grounded and on standby. It can be launched any time."]
3562 MAV_STATE_STANDBY = 3,
3563 #[doc = "System is active and might be already airborne. Motors are engaged."]
3564 MAV_STATE_ACTIVE = 4,
3565 #[doc = "System is in a non-normal flight mode (failsafe). It can however still navigate."]
3566 MAV_STATE_CRITICAL = 5,
3567 #[doc = "System is in a non-normal flight mode (failsafe). It lost control over parts or over the whole airframe. It is in mayday and going down."]
3568 MAV_STATE_EMERGENCY = 6,
3569 #[doc = "System just initialized its power-down sequence, will shut down now."]
3570 MAV_STATE_POWEROFF = 7,
3571 #[doc = "System is terminating itself (failsafe or commanded)."]
3572 MAV_STATE_FLIGHT_TERMINATION = 8,
3573}
3574impl MavState {
3575 pub const DEFAULT: Self = Self::MAV_STATE_UNINIT;
3576}
3577impl Default for MavState {
3578 fn default() -> Self {
3579 Self::DEFAULT
3580 }
3581}
3582bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These encode the sensors whose status is sent as part of the SYS_STATUS message."] pub struct MavSysStatusSensor : u32 { # [doc = "0x01 3D gyro"] const MAV_SYS_STATUS_SENSOR_3D_GYRO = 1 ; # [doc = "0x02 3D accelerometer"] const MAV_SYS_STATUS_SENSOR_3D_ACCEL = 2 ; # [doc = "0x04 3D magnetometer"] const MAV_SYS_STATUS_SENSOR_3D_MAG = 4 ; # [doc = "0x08 absolute pressure"] const MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE = 8 ; # [doc = "0x10 differential pressure"] const MAV_SYS_STATUS_SENSOR_DIFFERENTIAL_PRESSURE = 16 ; # [doc = "0x20 GPS"] const MAV_SYS_STATUS_SENSOR_GPS = 32 ; # [doc = "0x40 optical flow"] const MAV_SYS_STATUS_SENSOR_OPTICAL_FLOW = 64 ; # [doc = "0x80 computer vision position"] const MAV_SYS_STATUS_SENSOR_VISION_POSITION = 128 ; # [doc = "0x100 laser based position"] const MAV_SYS_STATUS_SENSOR_LASER_POSITION = 256 ; # [doc = "0x200 external ground truth (Vicon or Leica)"] const MAV_SYS_STATUS_SENSOR_EXTERNAL_GROUND_TRUTH = 512 ; # [doc = "0x400 3D angular rate control"] const MAV_SYS_STATUS_SENSOR_ANGULAR_RATE_CONTROL = 1024 ; # [doc = "0x800 attitude stabilization"] const MAV_SYS_STATUS_SENSOR_ATTITUDE_STABILIZATION = 2048 ; # [doc = "0x1000 yaw position"] const MAV_SYS_STATUS_SENSOR_YAW_POSITION = 4096 ; # [doc = "0x2000 z/altitude control"] const MAV_SYS_STATUS_SENSOR_Z_ALTITUDE_CONTROL = 8192 ; # [doc = "0x4000 x/y position control"] const MAV_SYS_STATUS_SENSOR_XY_POSITION_CONTROL = 16384 ; # [doc = "0x8000 motor outputs / control"] const MAV_SYS_STATUS_SENSOR_MOTOR_OUTPUTS = 32768 ; # [doc = "0x10000 RC receiver"] const MAV_SYS_STATUS_SENSOR_RC_RECEIVER = 65536 ; # [doc = "0x20000 2nd 3D gyro"] const MAV_SYS_STATUS_SENSOR_3D_GYRO2 = 131072 ; # [doc = "0x40000 2nd 3D accelerometer"] const MAV_SYS_STATUS_SENSOR_3D_ACCEL2 = 262144 ; # [doc = "0x80000 2nd 3D magnetometer"] const MAV_SYS_STATUS_SENSOR_3D_MAG2 = 524288 ; # [doc = "0x100000 geofence"] const MAV_SYS_STATUS_GEOFENCE = 1048576 ; # [doc = "0x200000 AHRS subsystem health"] const MAV_SYS_STATUS_AHRS = 2097152 ; # [doc = "0x400000 Terrain subsystem health"] const MAV_SYS_STATUS_TERRAIN = 4194304 ; # [doc = "0x800000 Motors are reversed"] const MAV_SYS_STATUS_REVERSE_MOTOR = 8388608 ; # [doc = "0x1000000 Logging"] const MAV_SYS_STATUS_LOGGING = 16777216 ; # [doc = "0x2000000 Battery"] const MAV_SYS_STATUS_SENSOR_BATTERY = 33554432 ; # [doc = "0x4000000 Proximity"] const MAV_SYS_STATUS_SENSOR_PROXIMITY = 67108864 ; # [doc = "0x8000000 Satellite Communication"] const MAV_SYS_STATUS_SENSOR_SATCOM = 134217728 ; # [doc = "0x10000000 pre-arm check status. Always healthy when armed"] const MAV_SYS_STATUS_PREARM_CHECK = 268435456 ; # [doc = "0x20000000 Avoidance/collision prevention"] const MAV_SYS_STATUS_OBSTACLE_AVOIDANCE = 536870912 ; # [doc = "0x40000000 propulsion (actuator, esc, motor or propellor)"] const MAV_SYS_STATUS_SENSOR_PROPULSION = 1073741824 ; # [doc = "0x80000000 Extended bit-field are used for further sensor status bits (needs to be set in onboard_control_sensors_present only)"] const MAV_SYS_STATUS_EXTENSION_USED = 2147483648 ; } }
3583impl MavSysStatusSensor {
3584 pub const DEFAULT: Self = Self::MAV_SYS_STATUS_SENSOR_3D_GYRO;
3585}
3586impl Default for MavSysStatusSensor {
3587 fn default() -> Self {
3588 Self::DEFAULT
3589 }
3590}
3591bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These encode the sensors whose status is sent as part of the SYS_STATUS message in the extended fields."] pub struct MavSysStatusSensorExtended : u32 { # [doc = "0x01 Recovery system (parachute, balloon, retracts etc)"] const MAV_SYS_STATUS_RECOVERY_SYSTEM = 1 ; } }
3592impl MavSysStatusSensorExtended {
3593 pub const DEFAULT: Self = Self::MAV_SYS_STATUS_RECOVERY_SYSTEM;
3594}
3595impl Default for MavSysStatusSensorExtended {
3596 fn default() -> Self {
3597 Self::DEFAULT
3598 }
3599}
3600#[cfg_attr(feature = "ts", derive(TS))]
3601#[cfg_attr(feature = "ts", ts(export))]
3602#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3603#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3604#[cfg_attr(feature = "serde", serde(tag = "type"))]
3605#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3606#[repr(u32)]
3607pub enum MavTunnelPayloadType {
3608 #[doc = "Encoding of payload unknown."]
3609 MAV_TUNNEL_PAYLOAD_TYPE_UNKNOWN = 0,
3610 #[doc = "Registered for STorM32 gimbal controller."]
3611 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED0 = 200,
3612 #[doc = "Registered for STorM32 gimbal controller."]
3613 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED1 = 201,
3614 #[doc = "Registered for STorM32 gimbal controller."]
3615 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED2 = 202,
3616 #[doc = "Registered for STorM32 gimbal controller."]
3617 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED3 = 203,
3618 #[doc = "Registered for STorM32 gimbal controller."]
3619 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED4 = 204,
3620 #[doc = "Registered for STorM32 gimbal controller."]
3621 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED5 = 205,
3622 #[doc = "Registered for STorM32 gimbal controller."]
3623 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED6 = 206,
3624 #[doc = "Registered for STorM32 gimbal controller."]
3625 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED7 = 207,
3626 #[doc = "Registered for STorM32 gimbal controller."]
3627 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED8 = 208,
3628 #[doc = "Registered for STorM32 gimbal controller."]
3629 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED9 = 209,
3630 #[doc = "Registered for ModalAI remote OSD protocol."]
3631 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_REMOTE_OSD = 210,
3632 #[doc = "Registered for ModalAI ESC UART passthru protocol."]
3633 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_ESC_UART_PASSTHRU = 211,
3634 #[doc = "Registered for ModalAI vendor use."]
3635 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_IO_UART_PASSTHRU = 212,
3636}
3637impl MavTunnelPayloadType {
3638 pub const DEFAULT: Self = Self::MAV_TUNNEL_PAYLOAD_TYPE_UNKNOWN;
3639}
3640impl Default for MavTunnelPayloadType {
3641 fn default() -> Self {
3642 Self::DEFAULT
3643 }
3644}
3645#[cfg_attr(feature = "ts", derive(TS))]
3646#[cfg_attr(feature = "ts", ts(export))]
3647#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3648#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3649#[cfg_attr(feature = "serde", serde(tag = "type"))]
3650#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3651#[repr(u32)]
3652#[doc = "MAVLINK component type reported in HEARTBEAT message. Flight controllers must report the type of the vehicle on which they are mounted (e.g. MAV_TYPE_OCTOROTOR). All other components must report a value appropriate for their type (e.g. a camera must use MAV_TYPE_CAMERA)."]
3653pub enum MavType {
3654 #[doc = "Generic micro air vehicle"]
3655 MAV_TYPE_GENERIC = 0,
3656 #[doc = "Fixed wing aircraft."]
3657 MAV_TYPE_FIXED_WING = 1,
3658 #[doc = "Quadrotor"]
3659 MAV_TYPE_QUADROTOR = 2,
3660 #[doc = "Coaxial helicopter"]
3661 MAV_TYPE_COAXIAL = 3,
3662 #[doc = "Normal helicopter with tail rotor."]
3663 MAV_TYPE_HELICOPTER = 4,
3664 #[doc = "Ground installation"]
3665 MAV_TYPE_ANTENNA_TRACKER = 5,
3666 #[doc = "Operator control unit / ground control station"]
3667 MAV_TYPE_GCS = 6,
3668 #[doc = "Airship, controlled"]
3669 MAV_TYPE_AIRSHIP = 7,
3670 #[doc = "Free balloon, uncontrolled"]
3671 MAV_TYPE_FREE_BALLOON = 8,
3672 #[doc = "Rocket"]
3673 MAV_TYPE_ROCKET = 9,
3674 #[doc = "Ground rover"]
3675 MAV_TYPE_GROUND_ROVER = 10,
3676 #[doc = "Surface vessel, boat, ship"]
3677 MAV_TYPE_SURFACE_BOAT = 11,
3678 #[doc = "Submarine"]
3679 MAV_TYPE_SUBMARINE = 12,
3680 #[doc = "Hexarotor"]
3681 MAV_TYPE_HEXAROTOR = 13,
3682 #[doc = "Octorotor"]
3683 MAV_TYPE_OCTOROTOR = 14,
3684 #[doc = "Tricopter"]
3685 MAV_TYPE_TRICOPTER = 15,
3686 #[doc = "Flapping wing"]
3687 MAV_TYPE_FLAPPING_WING = 16,
3688 #[doc = "Kite"]
3689 MAV_TYPE_KITE = 17,
3690 #[doc = "Onboard companion controller"]
3691 MAV_TYPE_ONBOARD_CONTROLLER = 18,
3692 #[doc = "Two-rotor Tailsitter VTOL that additionally uses control surfaces in vertical operation. Note, value previously named MAV_TYPE_VTOL_DUOROTOR."]
3693 MAV_TYPE_VTOL_TAILSITTER_DUOROTOR = 19,
3694 #[doc = "Quad-rotor Tailsitter VTOL using a V-shaped quad config in vertical operation. Note: value previously named MAV_TYPE_VTOL_QUADROTOR."]
3695 MAV_TYPE_VTOL_TAILSITTER_QUADROTOR = 20,
3696 #[doc = "Tiltrotor VTOL. Fuselage and wings stay (nominally) horizontal in all flight phases. It able to tilt (some) rotors to provide thrust in cruise flight."]
3697 MAV_TYPE_VTOL_TILTROTOR = 21,
3698 #[doc = "VTOL with separate fixed rotors for hover and cruise flight. Fuselage and wings stay (nominally) horizontal in all flight phases."]
3699 MAV_TYPE_VTOL_FIXEDROTOR = 22,
3700 #[doc = "Tailsitter VTOL. Fuselage and wings orientation changes depending on flight phase: vertical for hover, horizontal for cruise. Use more specific VTOL MAV_TYPE_VTOL_TAILSITTER_DUOROTOR or MAV_TYPE_VTOL_TAILSITTER_QUADROTOR if appropriate."]
3701 MAV_TYPE_VTOL_TAILSITTER = 23,
3702 #[doc = "Tiltwing VTOL. Fuselage stays horizontal in all flight phases. The whole wing, along with any attached engine, can tilt between vertical and horizontal mode."]
3703 MAV_TYPE_VTOL_TILTWING = 24,
3704 #[doc = "VTOL reserved 5"]
3705 MAV_TYPE_VTOL_RESERVED5 = 25,
3706 #[doc = "Gimbal"]
3707 MAV_TYPE_GIMBAL = 26,
3708 #[doc = "ADSB system"]
3709 MAV_TYPE_ADSB = 27,
3710 #[doc = "Steerable, nonrigid airfoil"]
3711 MAV_TYPE_PARAFOIL = 28,
3712 #[doc = "Dodecarotor"]
3713 MAV_TYPE_DODECAROTOR = 29,
3714 #[doc = "Camera"]
3715 MAV_TYPE_CAMERA = 30,
3716 #[doc = "Charging station"]
3717 MAV_TYPE_CHARGING_STATION = 31,
3718 #[doc = "FLARM collision avoidance system"]
3719 MAV_TYPE_FLARM = 32,
3720 #[doc = "Servo"]
3721 MAV_TYPE_SERVO = 33,
3722 #[doc = "Open Drone ID. See <https://mavlink.io/en/services/opendroneid.html>."]
3723 MAV_TYPE_ODID = 34,
3724 #[doc = "Decarotor"]
3725 MAV_TYPE_DECAROTOR = 35,
3726 #[doc = "Battery"]
3727 MAV_TYPE_BATTERY = 36,
3728 #[doc = "Parachute"]
3729 MAV_TYPE_PARACHUTE = 37,
3730 #[doc = "Log"]
3731 MAV_TYPE_LOG = 38,
3732 #[doc = "OSD"]
3733 MAV_TYPE_OSD = 39,
3734 #[doc = "IMU"]
3735 MAV_TYPE_IMU = 40,
3736 #[doc = "GPS"]
3737 MAV_TYPE_GPS = 41,
3738 #[doc = "Winch"]
3739 MAV_TYPE_WINCH = 42,
3740 #[doc = "Generic multirotor that does not fit into a specific type or whose type is unknown"]
3741 MAV_TYPE_GENERIC_MULTIROTOR = 43,
3742 #[doc = "Illuminator. An illuminator is a light source that is used for lighting up dark areas external to the sytstem: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
3743 MAV_TYPE_ILLUMINATOR = 44,
3744 #[doc = "Orbiter spacecraft. Includes satellites orbiting terrestrial and extra-terrestrial bodies. Follows NASA Spacecraft Classification."]
3745 MAV_TYPE_SPACECRAFT_ORBITER = 45,
3746}
3747impl MavType {
3748 pub const DEFAULT: Self = Self::MAV_TYPE_GENERIC;
3749}
3750impl Default for MavType {
3751 fn default() -> Self {
3752 Self::DEFAULT
3753 }
3754}
3755#[cfg_attr(feature = "ts", derive(TS))]
3756#[cfg_attr(feature = "ts", ts(export))]
3757#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3758#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3759#[cfg_attr(feature = "serde", serde(tag = "type"))]
3760#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3761#[repr(u32)]
3762#[doc = "Enumeration of VTOL states"]
3763pub enum MavVtolState {
3764 #[doc = "MAV is not configured as VTOL"]
3765 MAV_VTOL_STATE_UNDEFINED = 0,
3766 #[doc = "VTOL is in transition from multicopter to fixed-wing"]
3767 MAV_VTOL_STATE_TRANSITION_TO_FW = 1,
3768 #[doc = "VTOL is in transition from fixed-wing to multicopter"]
3769 MAV_VTOL_STATE_TRANSITION_TO_MC = 2,
3770 #[doc = "VTOL is in multicopter state"]
3771 MAV_VTOL_STATE_MC = 3,
3772 #[doc = "VTOL is in fixed-wing state"]
3773 MAV_VTOL_STATE_FW = 4,
3774}
3775impl MavVtolState {
3776 pub const DEFAULT: Self = Self::MAV_VTOL_STATE_UNDEFINED;
3777}
3778impl Default for MavVtolState {
3779 fn default() -> Self {
3780 Self::DEFAULT
3781 }
3782}
3783bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Winch status flags used in WINCH_STATUS"] pub struct MavWinchStatusFlag : u32 { # [doc = "Winch is healthy"] const MAV_WINCH_STATUS_HEALTHY = 1 ; # [doc = "Winch line is fully retracted"] const MAV_WINCH_STATUS_FULLY_RETRACTED = 2 ; # [doc = "Winch motor is moving"] const MAV_WINCH_STATUS_MOVING = 4 ; # [doc = "Winch clutch is engaged allowing motor to move freely."] const MAV_WINCH_STATUS_CLUTCH_ENGAGED = 8 ; # [doc = "Winch is locked by locking mechanism."] const MAV_WINCH_STATUS_LOCKED = 16 ; # [doc = "Winch is gravity dropping payload."] const MAV_WINCH_STATUS_DROPPING = 32 ; # [doc = "Winch is arresting payload descent."] const MAV_WINCH_STATUS_ARRESTING = 64 ; # [doc = "Winch is using torque measurements to sense the ground."] const MAV_WINCH_STATUS_GROUND_SENSE = 128 ; # [doc = "Winch is returning to the fully retracted position."] const MAV_WINCH_STATUS_RETRACTING = 256 ; # [doc = "Winch is redelivering the payload. This is a failover state if the line tension goes above a threshold during RETRACTING."] const MAV_WINCH_STATUS_REDELIVER = 512 ; # [doc = "Winch is abandoning the line and possibly payload. Winch unspools the entire calculated line length. This is a failover state from REDELIVER if the number of attempts exceeds a threshold."] const MAV_WINCH_STATUS_ABANDON_LINE = 1024 ; # [doc = "Winch is engaging the locking mechanism."] const MAV_WINCH_STATUS_LOCKING = 2048 ; # [doc = "Winch is spooling on line."] const MAV_WINCH_STATUS_LOAD_LINE = 4096 ; # [doc = "Winch is loading a payload."] const MAV_WINCH_STATUS_LOAD_PAYLOAD = 8192 ; } }
3784impl MavWinchStatusFlag {
3785 pub const DEFAULT: Self = Self::MAV_WINCH_STATUS_HEALTHY;
3786}
3787impl Default for MavWinchStatusFlag {
3788 fn default() -> Self {
3789 Self::DEFAULT
3790 }
3791}
3792#[cfg_attr(feature = "ts", derive(TS))]
3793#[cfg_attr(feature = "ts", ts(export))]
3794#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3795#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3796#[cfg_attr(feature = "serde", serde(tag = "type"))]
3797#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3798#[repr(u32)]
3799pub enum MavlinkDataStreamType {
3800 MAVLINK_DATA_STREAM_IMG_JPEG = 0,
3801 MAVLINK_DATA_STREAM_IMG_BMP = 1,
3802 MAVLINK_DATA_STREAM_IMG_RAW8U = 2,
3803 MAVLINK_DATA_STREAM_IMG_RAW32U = 3,
3804 MAVLINK_DATA_STREAM_IMG_PGM = 4,
3805 MAVLINK_DATA_STREAM_IMG_PNG = 5,
3806}
3807impl MavlinkDataStreamType {
3808 pub const DEFAULT: Self = Self::MAVLINK_DATA_STREAM_IMG_JPEG;
3809}
3810impl Default for MavlinkDataStreamType {
3811 fn default() -> Self {
3812 Self::DEFAULT
3813 }
3814}
3815#[cfg_attr(feature = "ts", derive(TS))]
3816#[cfg_attr(feature = "ts", ts(export))]
3817#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3818#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3819#[cfg_attr(feature = "serde", serde(tag = "type"))]
3820#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3821#[repr(u32)]
3822#[doc = "States of the mission state machine. Note that these states are independent of whether the mission is in a mode that can execute mission items or not (is suspended). They may not all be relevant on all vehicles."]
3823pub enum MissionState {
3824 #[doc = "The mission status reporting is not supported."]
3825 MISSION_STATE_UNKNOWN = 0,
3826 #[doc = "No mission on the vehicle."]
3827 MISSION_STATE_NO_MISSION = 1,
3828 #[doc = "Mission has not started. This is the case after a mission has uploaded but not yet started executing."]
3829 MISSION_STATE_NOT_STARTED = 2,
3830 #[doc = "Mission is active, and will execute mission items when in auto mode."]
3831 MISSION_STATE_ACTIVE = 3,
3832 #[doc = "Mission is paused when in auto mode."]
3833 MISSION_STATE_PAUSED = 4,
3834 #[doc = "Mission has executed all mission items."]
3835 MISSION_STATE_COMPLETE = 5,
3836}
3837impl MissionState {
3838 pub const DEFAULT: Self = Self::MISSION_STATE_UNKNOWN;
3839}
3840impl Default for MissionState {
3841 fn default() -> Self {
3842 Self::DEFAULT
3843 }
3844}
3845#[cfg_attr(feature = "ts", derive(TS))]
3846#[cfg_attr(feature = "ts", ts(export))]
3847#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3848#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3849#[cfg_attr(feature = "serde", serde(tag = "type"))]
3850#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3851#[repr(u32)]
3852#[doc = "Sequence that motors are tested when using MAV_CMD_DO_MOTOR_TEST."]
3853pub enum MotorTestOrder {
3854 #[doc = "Default autopilot motor test method."]
3855 MOTOR_TEST_ORDER_DEFAULT = 0,
3856 #[doc = "Motor numbers are specified as their index in a predefined vehicle-specific sequence."]
3857 MOTOR_TEST_ORDER_SEQUENCE = 1,
3858 #[doc = "Motor numbers are specified as the output as labeled on the board."]
3859 MOTOR_TEST_ORDER_BOARD = 2,
3860}
3861impl MotorTestOrder {
3862 pub const DEFAULT: Self = Self::MOTOR_TEST_ORDER_DEFAULT;
3863}
3864impl Default for MotorTestOrder {
3865 fn default() -> Self {
3866 Self::DEFAULT
3867 }
3868}
3869#[cfg_attr(feature = "ts", derive(TS))]
3870#[cfg_attr(feature = "ts", ts(export))]
3871#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3872#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3873#[cfg_attr(feature = "serde", serde(tag = "type"))]
3874#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3875#[repr(u32)]
3876#[doc = "Defines how throttle value is represented in MAV_CMD_DO_MOTOR_TEST."]
3877pub enum MotorTestThrottleType {
3878 #[doc = "Throttle as a percentage (0 ~ 100)"]
3879 MOTOR_TEST_THROTTLE_PERCENT = 0,
3880 #[doc = "Throttle as an absolute PWM value (normally in range of 1000~2000)."]
3881 MOTOR_TEST_THROTTLE_PWM = 1,
3882 #[doc = "Throttle pass-through from pilot's transmitter."]
3883 MOTOR_TEST_THROTTLE_PILOT = 2,
3884 #[doc = "Per-motor compass calibration test."]
3885 MOTOR_TEST_COMPASS_CAL = 3,
3886}
3887impl MotorTestThrottleType {
3888 pub const DEFAULT: Self = Self::MOTOR_TEST_THROTTLE_PERCENT;
3889}
3890impl Default for MotorTestThrottleType {
3891 fn default() -> Self {
3892 Self::DEFAULT
3893 }
3894}
3895#[cfg_attr(feature = "ts", derive(TS))]
3896#[cfg_attr(feature = "ts", ts(export))]
3897#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3898#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3899#[cfg_attr(feature = "serde", serde(tag = "type"))]
3900#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3901#[repr(u32)]
3902pub enum NavVtolLandOptions {
3903 #[doc = "Default autopilot landing behaviour."]
3904 NAV_VTOL_LAND_OPTIONS_DEFAULT = 0,
3905 #[doc = "Descend in fixed wing mode, transitioning to multicopter mode for vertical landing when close to the ground. The fixed wing descent pattern is at the discretion of the vehicle (e.g. transition altitude, loiter direction, radius, and speed, etc.)."]
3906 NAV_VTOL_LAND_OPTIONS_FW_DESCENT = 1,
3907 #[doc = "Land in multicopter mode on reaching the landing coordinates (the whole landing is by \"hover descent\")."]
3908 NAV_VTOL_LAND_OPTIONS_HOVER_DESCENT = 2,
3909}
3910impl NavVtolLandOptions {
3911 pub const DEFAULT: Self = Self::NAV_VTOL_LAND_OPTIONS_DEFAULT;
3912}
3913impl Default for NavVtolLandOptions {
3914 fn default() -> Self {
3915 Self::DEFAULT
3916 }
3917}
3918#[cfg_attr(feature = "ts", derive(TS))]
3919#[cfg_attr(feature = "ts", ts(export))]
3920#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3921#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3922#[cfg_attr(feature = "serde", serde(tag = "type"))]
3923#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3924#[repr(u32)]
3925#[doc = "Yaw behaviour during orbit flight."]
3926pub enum OrbitYawBehaviour {
3927 #[doc = "Vehicle front points to the center (default)."]
3928 ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TO_CIRCLE_CENTER = 0,
3929 #[doc = "Vehicle front holds heading when message received."]
3930 ORBIT_YAW_BEHAVIOUR_HOLD_INITIAL_HEADING = 1,
3931 #[doc = "Yaw uncontrolled."]
3932 ORBIT_YAW_BEHAVIOUR_UNCONTROLLED = 2,
3933 #[doc = "Vehicle front follows flight path (tangential to circle)."]
3934 ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TANGENT_TO_CIRCLE = 3,
3935 #[doc = "Yaw controlled by RC input."]
3936 ORBIT_YAW_BEHAVIOUR_RC_CONTROLLED = 4,
3937 #[doc = "Vehicle uses current yaw behaviour (unchanged). The vehicle-default yaw behaviour is used if this value is specified when orbit is first commanded."]
3938 ORBIT_YAW_BEHAVIOUR_UNCHANGED = 5,
3939}
3940impl OrbitYawBehaviour {
3941 pub const DEFAULT: Self = Self::ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TO_CIRCLE_CENTER;
3942}
3943impl Default for OrbitYawBehaviour {
3944 fn default() -> Self {
3945 Self::DEFAULT
3946 }
3947}
3948#[cfg_attr(feature = "ts", derive(TS))]
3949#[cfg_attr(feature = "ts", ts(export))]
3950#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3951#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3952#[cfg_attr(feature = "serde", serde(tag = "type"))]
3953#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3954#[repr(u32)]
3955#[doc = "Parachute actions. Trigger release and enable/disable auto-release."]
3956pub enum ParachuteAction {
3957 #[doc = "Disable auto-release of parachute (i.e. release triggered by crash detectors)."]
3958 PARACHUTE_DISABLE = 0,
3959 #[doc = "Enable auto-release of parachute."]
3960 PARACHUTE_ENABLE = 1,
3961 #[doc = "Release parachute and kill motors."]
3962 PARACHUTE_RELEASE = 2,
3963}
3964impl ParachuteAction {
3965 pub const DEFAULT: Self = Self::PARACHUTE_DISABLE;
3966}
3967impl Default for ParachuteAction {
3968 fn default() -> Self {
3969 Self::DEFAULT
3970 }
3971}
3972#[cfg_attr(feature = "ts", derive(TS))]
3973#[cfg_attr(feature = "ts", ts(export))]
3974#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3975#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3976#[cfg_attr(feature = "serde", serde(tag = "type"))]
3977#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3978#[repr(u32)]
3979#[doc = "Result from PARAM_EXT_SET message."]
3980pub enum ParamAck {
3981 #[doc = "Parameter value ACCEPTED and SET"]
3982 PARAM_ACK_ACCEPTED = 0,
3983 #[doc = "Parameter value UNKNOWN/UNSUPPORTED"]
3984 PARAM_ACK_VALUE_UNSUPPORTED = 1,
3985 #[doc = "Parameter failed to set"]
3986 PARAM_ACK_FAILED = 2,
3987 #[doc = "Parameter value received but not yet set/accepted. A subsequent PARAM_EXT_ACK with the final result will follow once operation is completed. This is returned immediately for parameters that take longer to set, indicating that the the parameter was received and does not need to be resent."]
3988 PARAM_ACK_IN_PROGRESS = 3,
3989}
3990impl ParamAck {
3991 pub const DEFAULT: Self = Self::PARAM_ACK_ACCEPTED;
3992}
3993impl Default for ParamAck {
3994 fn default() -> Self {
3995 Self::DEFAULT
3996 }
3997}
3998bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmap to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 9 is set the floats afx afy afz should be interpreted as force instead of acceleration."] pub struct PositionTargetTypemask : u16 { # [doc = "Ignore position x"] const POSITION_TARGET_TYPEMASK_X_IGNORE = 1 ; # [doc = "Ignore position y"] const POSITION_TARGET_TYPEMASK_Y_IGNORE = 2 ; # [doc = "Ignore position z"] const POSITION_TARGET_TYPEMASK_Z_IGNORE = 4 ; # [doc = "Ignore velocity x"] const POSITION_TARGET_TYPEMASK_VX_IGNORE = 8 ; # [doc = "Ignore velocity y"] const POSITION_TARGET_TYPEMASK_VY_IGNORE = 16 ; # [doc = "Ignore velocity z"] const POSITION_TARGET_TYPEMASK_VZ_IGNORE = 32 ; # [doc = "Ignore acceleration x"] const POSITION_TARGET_TYPEMASK_AX_IGNORE = 64 ; # [doc = "Ignore acceleration y"] const POSITION_TARGET_TYPEMASK_AY_IGNORE = 128 ; # [doc = "Ignore acceleration z"] const POSITION_TARGET_TYPEMASK_AZ_IGNORE = 256 ; # [doc = "Use force instead of acceleration"] const POSITION_TARGET_TYPEMASK_FORCE_SET = 512 ; # [doc = "Ignore yaw"] const POSITION_TARGET_TYPEMASK_YAW_IGNORE = 1024 ; # [doc = "Ignore yaw rate"] const POSITION_TARGET_TYPEMASK_YAW_RATE_IGNORE = 2048 ; } }
3999impl PositionTargetTypemask {
4000 pub const DEFAULT: Self = Self::POSITION_TARGET_TYPEMASK_X_IGNORE;
4001}
4002impl Default for PositionTargetTypemask {
4003 fn default() -> Self {
4004 Self::DEFAULT
4005 }
4006}
4007#[cfg_attr(feature = "ts", derive(TS))]
4008#[cfg_attr(feature = "ts", ts(export))]
4009#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4010#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4011#[cfg_attr(feature = "serde", serde(tag = "type"))]
4012#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4013#[repr(u32)]
4014#[doc = "Precision land modes (used in MAV_CMD_NAV_LAND)."]
4015pub enum PrecisionLandMode {
4016 #[doc = "Normal (non-precision) landing."]
4017 PRECISION_LAND_MODE_DISABLED = 0,
4018 #[doc = "Use precision landing if beacon detected when land command accepted, otherwise land normally."]
4019 PRECISION_LAND_MODE_OPPORTUNISTIC = 1,
4020 #[doc = "Use precision landing, searching for beacon if not found when land command accepted (land normally if beacon cannot be found)."]
4021 PRECISION_LAND_MODE_REQUIRED = 2,
4022}
4023impl PrecisionLandMode {
4024 pub const DEFAULT: Self = Self::PRECISION_LAND_MODE_DISABLED;
4025}
4026impl Default for PrecisionLandMode {
4027 fn default() -> Self {
4028 Self::DEFAULT
4029 }
4030}
4031#[cfg_attr(feature = "ts", derive(TS))]
4032#[cfg_attr(feature = "ts", ts(export))]
4033#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4034#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4035#[cfg_attr(feature = "serde", serde(tag = "type"))]
4036#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4037#[repr(u32)]
4038#[doc = "Actions for reading and writing plan information (mission, rally points, geofence) between persistent and volatile storage when using MAV_CMD_PREFLIGHT_STORAGE. (Commonly missions are loaded from persistent storage (flash/EEPROM) into volatile storage (RAM) on startup and written back when they are changed.)"]
4039pub enum PreflightStorageMissionAction {
4040 #[doc = "Read current mission data from persistent storage"]
4041 MISSION_READ_PERSISTENT = 0,
4042 #[doc = "Write current mission data to persistent storage"]
4043 MISSION_WRITE_PERSISTENT = 1,
4044 #[doc = "Erase all mission data stored on the vehicle (both persistent and volatile storage)"]
4045 MISSION_RESET_DEFAULT = 2,
4046}
4047impl PreflightStorageMissionAction {
4048 pub const DEFAULT: Self = Self::MISSION_READ_PERSISTENT;
4049}
4050impl Default for PreflightStorageMissionAction {
4051 fn default() -> Self {
4052 Self::DEFAULT
4053 }
4054}
4055#[cfg_attr(feature = "ts", derive(TS))]
4056#[cfg_attr(feature = "ts", ts(export))]
4057#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4058#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4059#[cfg_attr(feature = "serde", serde(tag = "type"))]
4060#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4061#[repr(u32)]
4062#[doc = "Actions for reading/writing parameters between persistent and volatile storage when using MAV_CMD_PREFLIGHT_STORAGE. (Commonly parameters are loaded from persistent storage (flash/EEPROM) into volatile storage (RAM) on startup and written back when they are changed.)"]
4063pub enum PreflightStorageParameterAction {
4064 #[doc = "Read all parameters from persistent storage. Replaces values in volatile storage."]
4065 PARAM_READ_PERSISTENT = 0,
4066 #[doc = "Write all parameter values to persistent storage (flash/EEPROM)"]
4067 PARAM_WRITE_PERSISTENT = 1,
4068 #[doc = "Reset all user configurable parameters to their default value (including airframe selection, sensor calibration data, safety settings, and so on). Does not reset values that contain operation counters and vehicle computed statistics."]
4069 PARAM_RESET_CONFIG_DEFAULT = 2,
4070 #[doc = "Reset only sensor calibration parameters to factory defaults (or firmware default if not available)"]
4071 PARAM_RESET_SENSOR_DEFAULT = 3,
4072 #[doc = "Reset all parameters, including operation counters, to default values"]
4073 PARAM_RESET_ALL_DEFAULT = 4,
4074}
4075impl PreflightStorageParameterAction {
4076 pub const DEFAULT: Self = Self::PARAM_READ_PERSISTENT;
4077}
4078impl Default for PreflightStorageParameterAction {
4079 fn default() -> Self {
4080 Self::DEFAULT
4081 }
4082}
4083#[cfg_attr(feature = "ts", derive(TS))]
4084#[cfg_attr(feature = "ts", ts(export))]
4085#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4086#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4087#[cfg_attr(feature = "serde", serde(tag = "type"))]
4088#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4089#[repr(u32)]
4090#[doc = "RC sub-type of types defined in RC_TYPE. Used in MAV_CMD_START_RX_PAIR. Ignored if value does not correspond to the set RC_TYPE."]
4091pub enum RcSubType {
4092 #[doc = "Spektrum DSM2"]
4093 RC_SUB_TYPE_SPEKTRUM_DSM2 = 0,
4094 #[doc = "Spektrum DSMX"]
4095 RC_SUB_TYPE_SPEKTRUM_DSMX = 1,
4096 #[doc = "Spektrum DSMX8"]
4097 RC_SUB_TYPE_SPEKTRUM_DSMX8 = 2,
4098}
4099impl RcSubType {
4100 pub const DEFAULT: Self = Self::RC_SUB_TYPE_SPEKTRUM_DSM2;
4101}
4102impl Default for RcSubType {
4103 fn default() -> Self {
4104 Self::DEFAULT
4105 }
4106}
4107#[cfg_attr(feature = "ts", derive(TS))]
4108#[cfg_attr(feature = "ts", ts(export))]
4109#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4110#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4111#[cfg_attr(feature = "serde", serde(tag = "type"))]
4112#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4113#[repr(u32)]
4114#[doc = "RC type. Used in MAV_CMD_START_RX_PAIR."]
4115pub enum RcType {
4116 #[doc = "Spektrum"]
4117 RC_TYPE_SPEKTRUM = 0,
4118 #[doc = "CRSF"]
4119 RC_TYPE_CRSF = 1,
4120}
4121impl RcType {
4122 pub const DEFAULT: Self = Self::RC_TYPE_SPEKTRUM;
4123}
4124impl Default for RcType {
4125 fn default() -> Self {
4126 Self::DEFAULT
4127 }
4128}
4129#[cfg_attr(feature = "ts", derive(TS))]
4130#[cfg_attr(feature = "ts", ts(export))]
4131#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4132#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4133#[cfg_attr(feature = "serde", serde(tag = "type"))]
4134#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4135#[repr(u32)]
4136#[doc = "Specifies the conditions under which the MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN command should be accepted."]
4137pub enum RebootShutdownConditions {
4138 #[doc = "Reboot/Shutdown only if allowed by safety checks, such as being landed."]
4139 REBOOT_SHUTDOWN_CONDITIONS_SAFETY_INTERLOCKED = 0,
4140 #[doc = "Force reboot/shutdown of the autopilot/component regardless of system state."]
4141 REBOOT_SHUTDOWN_CONDITIONS_FORCE = 20190226,
4142}
4143impl RebootShutdownConditions {
4144 pub const DEFAULT: Self = Self::REBOOT_SHUTDOWN_CONDITIONS_SAFETY_INTERLOCKED;
4145}
4146impl Default for RebootShutdownConditions {
4147 fn default() -> Self {
4148 Self::DEFAULT
4149 }
4150}
4151#[cfg_attr(feature = "ts", derive(TS))]
4152#[cfg_attr(feature = "ts", ts(export))]
4153#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4154#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4155#[cfg_attr(feature = "serde", serde(tag = "type"))]
4156#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4157#[repr(u32)]
4158#[doc = "RTK GPS baseline coordinate system, used for RTK corrections"]
4159pub enum RtkBaselineCoordinateSystem {
4160 #[doc = "Earth-centered, Earth-fixed"]
4161 RTK_BASELINE_COORDINATE_SYSTEM_ECEF = 0,
4162 #[doc = "RTK basestation centered, north, east, down"]
4163 RTK_BASELINE_COORDINATE_SYSTEM_NED = 1,
4164}
4165impl RtkBaselineCoordinateSystem {
4166 pub const DEFAULT: Self = Self::RTK_BASELINE_COORDINATE_SYSTEM_ECEF;
4167}
4168impl Default for RtkBaselineCoordinateSystem {
4169 fn default() -> Self {
4170 Self::DEFAULT
4171 }
4172}
4173#[cfg_attr(feature = "ts", derive(TS))]
4174#[cfg_attr(feature = "ts", ts(export))]
4175#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4176#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4177#[cfg_attr(feature = "serde", serde(tag = "type"))]
4178#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4179#[repr(u32)]
4180#[doc = "Possible safety switch states."]
4181pub enum SafetySwitchState {
4182 #[doc = "Safety switch is engaged and vehicle should be safe to approach."]
4183 SAFETY_SWITCH_STATE_SAFE = 0,
4184 #[doc = "Safety switch is NOT engaged and motors, propellers and other actuators should be considered active."]
4185 SAFETY_SWITCH_STATE_DANGEROUS = 1,
4186}
4187impl SafetySwitchState {
4188 pub const DEFAULT: Self = Self::SAFETY_SWITCH_STATE_SAFE;
4189}
4190impl Default for SafetySwitchState {
4191 fn default() -> Self {
4192 Self::DEFAULT
4193 }
4194}
4195#[cfg_attr(feature = "ts", derive(TS))]
4196#[cfg_attr(feature = "ts", ts(export))]
4197#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4198#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4199#[cfg_attr(feature = "serde", serde(tag = "type"))]
4200#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4201#[repr(u32)]
4202#[doc = "SERIAL_CONTROL device types"]
4203pub enum SerialControlDev {
4204 #[doc = "First telemetry port"]
4205 SERIAL_CONTROL_DEV_TELEM1 = 0,
4206 #[doc = "Second telemetry port"]
4207 SERIAL_CONTROL_DEV_TELEM2 = 1,
4208 #[doc = "First GPS port"]
4209 SERIAL_CONTROL_DEV_GPS1 = 2,
4210 #[doc = "Second GPS port"]
4211 SERIAL_CONTROL_DEV_GPS2 = 3,
4212 #[doc = "system shell"]
4213 SERIAL_CONTROL_DEV_SHELL = 10,
4214 #[doc = "SERIAL0"]
4215 SERIAL_CONTROL_SERIAL0 = 100,
4216 #[doc = "SERIAL1"]
4217 SERIAL_CONTROL_SERIAL1 = 101,
4218 #[doc = "SERIAL2"]
4219 SERIAL_CONTROL_SERIAL2 = 102,
4220 #[doc = "SERIAL3"]
4221 SERIAL_CONTROL_SERIAL3 = 103,
4222 #[doc = "SERIAL4"]
4223 SERIAL_CONTROL_SERIAL4 = 104,
4224 #[doc = "SERIAL5"]
4225 SERIAL_CONTROL_SERIAL5 = 105,
4226 #[doc = "SERIAL6"]
4227 SERIAL_CONTROL_SERIAL6 = 106,
4228 #[doc = "SERIAL7"]
4229 SERIAL_CONTROL_SERIAL7 = 107,
4230 #[doc = "SERIAL8"]
4231 SERIAL_CONTROL_SERIAL8 = 108,
4232 #[doc = "SERIAL9"]
4233 SERIAL_CONTROL_SERIAL9 = 109,
4234}
4235impl SerialControlDev {
4236 pub const DEFAULT: Self = Self::SERIAL_CONTROL_DEV_TELEM1;
4237}
4238impl Default for SerialControlDev {
4239 fn default() -> Self {
4240 Self::DEFAULT
4241 }
4242}
4243bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "SERIAL_CONTROL flags (bitmask)"] pub struct SerialControlFlag : u8 { # [doc = "Set if this is a reply"] const SERIAL_CONTROL_FLAG_REPLY = 1 ; # [doc = "Set if the sender wants the receiver to send a response as another SERIAL_CONTROL message"] const SERIAL_CONTROL_FLAG_RESPOND = 2 ; # [doc = "Set if access to the serial port should be removed from whatever driver is currently using it, giving exclusive access to the SERIAL_CONTROL protocol. The port can be handed back by sending a request without this flag set"] const SERIAL_CONTROL_FLAG_EXCLUSIVE = 4 ; # [doc = "Block on writes to the serial port"] const SERIAL_CONTROL_FLAG_BLOCKING = 8 ; # [doc = "Send multiple replies until port is drained"] const SERIAL_CONTROL_FLAG_MULTI = 16 ; } }
4244impl SerialControlFlag {
4245 pub const DEFAULT: Self = Self::SERIAL_CONTROL_FLAG_REPLY;
4246}
4247impl Default for SerialControlFlag {
4248 fn default() -> Self {
4249 Self::DEFAULT
4250 }
4251}
4252#[cfg_attr(feature = "ts", derive(TS))]
4253#[cfg_attr(feature = "ts", ts(export))]
4254#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4255#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4256#[cfg_attr(feature = "serde", serde(tag = "type"))]
4257#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4258#[repr(u32)]
4259#[doc = "Focus types for MAV_CMD_SET_CAMERA_FOCUS"]
4260pub enum SetFocusType {
4261 #[doc = "Focus one step increment (-1 for focusing in, 1 for focusing out towards infinity)."]
4262 FOCUS_TYPE_STEP = 0,
4263 #[doc = "Continuous normalized focus in/out rate until stopped. Range -1..1, negative: in, positive: out towards infinity, 0 to stop focusing. Other values should be clipped to the range."]
4264 FOCUS_TYPE_CONTINUOUS = 1,
4265 #[doc = "Focus value as proportion of full camera focus range (a value between 0.0 and 100.0)"]
4266 FOCUS_TYPE_RANGE = 2,
4267 #[doc = "Focus value in metres. Note that there is no message to get the valid focus range of the camera, so this can type can only be used for cameras where the range is known (implying that this cannot reliably be used in a GCS for an arbitrary camera)."]
4268 FOCUS_TYPE_METERS = 3,
4269 #[doc = "Focus automatically."]
4270 FOCUS_TYPE_AUTO = 4,
4271 #[doc = "Single auto focus. Mainly used for still pictures. Usually abbreviated as AF-S."]
4272 FOCUS_TYPE_AUTO_SINGLE = 5,
4273 #[doc = "Continuous auto focus. Mainly used for dynamic scenes. Abbreviated as AF-C."]
4274 FOCUS_TYPE_AUTO_CONTINUOUS = 6,
4275}
4276impl SetFocusType {
4277 pub const DEFAULT: Self = Self::FOCUS_TYPE_STEP;
4278}
4279impl Default for SetFocusType {
4280 fn default() -> Self {
4281 Self::DEFAULT
4282 }
4283}
4284#[cfg_attr(feature = "ts", derive(TS))]
4285#[cfg_attr(feature = "ts", ts(export))]
4286#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4287#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4288#[cfg_attr(feature = "serde", serde(tag = "type"))]
4289#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4290#[repr(u32)]
4291#[doc = "Speed setpoint types used in MAV_CMD_DO_CHANGE_SPEED"]
4292pub enum SpeedType {
4293 #[doc = "Airspeed"]
4294 SPEED_TYPE_AIRSPEED = 0,
4295 #[doc = "Groundspeed"]
4296 SPEED_TYPE_GROUNDSPEED = 1,
4297 #[doc = "Climb speed"]
4298 SPEED_TYPE_CLIMB_SPEED = 2,
4299 #[doc = "Descent speed"]
4300 SPEED_TYPE_DESCENT_SPEED = 3,
4301}
4302impl SpeedType {
4303 pub const DEFAULT: Self = Self::SPEED_TYPE_AIRSPEED;
4304}
4305impl Default for SpeedType {
4306 fn default() -> Self {
4307 Self::DEFAULT
4308 }
4309}
4310#[cfg_attr(feature = "ts", derive(TS))]
4311#[cfg_attr(feature = "ts", ts(export))]
4312#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4313#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4314#[cfg_attr(feature = "serde", serde(tag = "type"))]
4315#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4316#[repr(u32)]
4317#[doc = "Flags to indicate the status of camera storage."]
4318pub enum StorageStatus {
4319 #[doc = "Storage is missing (no microSD card loaded for example.)"]
4320 STORAGE_STATUS_EMPTY = 0,
4321 #[doc = "Storage present but unformatted."]
4322 STORAGE_STATUS_UNFORMATTED = 1,
4323 #[doc = "Storage present and ready."]
4324 STORAGE_STATUS_READY = 2,
4325 #[doc = "Camera does not supply storage status information. Capacity information in STORAGE_INFORMATION fields will be ignored."]
4326 STORAGE_STATUS_NOT_SUPPORTED = 3,
4327}
4328impl StorageStatus {
4329 pub const DEFAULT: Self = Self::STORAGE_STATUS_EMPTY;
4330}
4331impl Default for StorageStatus {
4332 fn default() -> Self {
4333 Self::DEFAULT
4334 }
4335}
4336#[cfg_attr(feature = "ts", derive(TS))]
4337#[cfg_attr(feature = "ts", ts(export))]
4338#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4339#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4340#[cfg_attr(feature = "serde", serde(tag = "type"))]
4341#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4342#[repr(u32)]
4343#[doc = "Flags to indicate the type of storage."]
4344pub enum StorageType {
4345 #[doc = "Storage type is not known."]
4346 STORAGE_TYPE_UNKNOWN = 0,
4347 #[doc = "Storage type is USB device."]
4348 STORAGE_TYPE_USB_STICK = 1,
4349 #[doc = "Storage type is SD card."]
4350 STORAGE_TYPE_SD = 2,
4351 #[doc = "Storage type is microSD card."]
4352 STORAGE_TYPE_MICROSD = 3,
4353 #[doc = "Storage type is CFast."]
4354 STORAGE_TYPE_CF = 4,
4355 #[doc = "Storage type is CFexpress."]
4356 STORAGE_TYPE_CFE = 5,
4357 #[doc = "Storage type is XQD."]
4358 STORAGE_TYPE_XQD = 6,
4359 #[doc = "Storage type is HD mass storage type."]
4360 STORAGE_TYPE_HD = 7,
4361 #[doc = "Storage type is other, not listed type."]
4362 STORAGE_TYPE_OTHER = 254,
4363}
4364impl StorageType {
4365 pub const DEFAULT: Self = Self::STORAGE_TYPE_UNKNOWN;
4366}
4367impl Default for StorageType {
4368 fn default() -> Self {
4369 Self::DEFAULT
4370 }
4371}
4372bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to indicate usage for a particular storage (see STORAGE_INFORMATION.storage_usage and MAV_CMD_SET_STORAGE_USAGE)."] pub struct StorageUsageFlag : u8 { # [doc = "Always set to 1 (indicates STORAGE_INFORMATION.storage_usage is supported)."] const STORAGE_USAGE_FLAG_SET = 1 ; # [doc = "Storage for saving photos."] const STORAGE_USAGE_FLAG_PHOTO = 2 ; # [doc = "Storage for saving videos."] const STORAGE_USAGE_FLAG_VIDEO = 4 ; # [doc = "Storage for saving logs."] const STORAGE_USAGE_FLAG_LOGS = 8 ; } }
4373impl StorageUsageFlag {
4374 pub const DEFAULT: Self = Self::STORAGE_USAGE_FLAG_SET;
4375}
4376impl Default for StorageUsageFlag {
4377 fn default() -> Self {
4378 Self::DEFAULT
4379 }
4380}
4381#[cfg_attr(feature = "ts", derive(TS))]
4382#[cfg_attr(feature = "ts", ts(export))]
4383#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4384#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4385#[cfg_attr(feature = "serde", serde(tag = "type"))]
4386#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4387#[repr(u32)]
4388#[doc = "Tune formats (used for vehicle buzzer/tone generation)."]
4389pub enum TuneFormat {
4390 #[doc = "Format is QBasic 1.1 Play: <https://www.qbasic.net/en/reference/qb11/Statement/PLAY-006.htm>."]
4391 TUNE_FORMAT_QBASIC1_1 = 1,
4392 #[doc = "Format is Modern Music Markup Language (MML): <https://en.wikipedia.org/wiki/Music_Macro_Language#Modern_MML>."]
4393 TUNE_FORMAT_MML_MODERN = 2,
4394}
4395impl TuneFormat {
4396 pub const DEFAULT: Self = Self::TUNE_FORMAT_QBASIC1_1;
4397}
4398impl Default for TuneFormat {
4399 fn default() -> Self {
4400 Self::DEFAULT
4401 }
4402}
4403#[cfg_attr(feature = "ts", derive(TS))]
4404#[cfg_attr(feature = "ts", ts(export))]
4405#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4406#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4407#[cfg_attr(feature = "serde", serde(tag = "type"))]
4408#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4409#[repr(u32)]
4410#[doc = "Available autopilot modes for ualberta uav"]
4411pub enum UalbertaAutopilotMode {
4412 #[doc = "Raw input pulse widts sent to output"]
4413 MODE_MANUAL_DIRECT = 1,
4414 #[doc = "Inputs are normalized using calibration, the converted back to raw pulse widths for output"]
4415 MODE_MANUAL_SCALED = 2,
4416 MODE_AUTO_PID_ATT = 3,
4417 MODE_AUTO_PID_VEL = 4,
4418 MODE_AUTO_PID_POS = 5,
4419}
4420impl UalbertaAutopilotMode {
4421 pub const DEFAULT: Self = Self::MODE_MANUAL_DIRECT;
4422}
4423impl Default for UalbertaAutopilotMode {
4424 fn default() -> Self {
4425 Self::DEFAULT
4426 }
4427}
4428#[cfg_attr(feature = "ts", derive(TS))]
4429#[cfg_attr(feature = "ts", ts(export))]
4430#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4431#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4432#[cfg_attr(feature = "serde", serde(tag = "type"))]
4433#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4434#[repr(u32)]
4435#[doc = "Navigation filter mode"]
4436pub enum UalbertaNavMode {
4437 NAV_AHRS_INIT = 1,
4438 #[doc = "AHRS mode"]
4439 NAV_AHRS = 2,
4440 #[doc = "INS/GPS initialization mode"]
4441 NAV_INS_GPS_INIT = 3,
4442 #[doc = "INS/GPS mode"]
4443 NAV_INS_GPS = 4,
4444}
4445impl UalbertaNavMode {
4446 pub const DEFAULT: Self = Self::NAV_AHRS_INIT;
4447}
4448impl Default for UalbertaNavMode {
4449 fn default() -> Self {
4450 Self::DEFAULT
4451 }
4452}
4453#[cfg_attr(feature = "ts", derive(TS))]
4454#[cfg_attr(feature = "ts", ts(export))]
4455#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4456#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4457#[cfg_attr(feature = "serde", serde(tag = "type"))]
4458#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4459#[repr(u32)]
4460#[doc = "Mode currently commanded by pilot"]
4461pub enum UalbertaPilotMode {
4462 PILOT_MANUAL = 1,
4463 PILOT_AUTO = 2,
4464 #[doc = "Rotomotion mode"]
4465 PILOT_ROTO = 3,
4466}
4467impl UalbertaPilotMode {
4468 pub const DEFAULT: Self = Self::PILOT_MANUAL;
4469}
4470impl Default for UalbertaPilotMode {
4471 fn default() -> Self {
4472 Self::DEFAULT
4473 }
4474}
4475#[cfg_attr(feature = "ts", derive(TS))]
4476#[cfg_attr(feature = "ts", ts(export))]
4477#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4478#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4479#[cfg_attr(feature = "serde", serde(tag = "type"))]
4480#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4481#[repr(u32)]
4482#[doc = "Generalized UAVCAN node health"]
4483pub enum UavcanNodeHealth {
4484 #[doc = "The node is functioning properly."]
4485 UAVCAN_NODE_HEALTH_OK = 0,
4486 #[doc = "A critical parameter went out of range or the node has encountered a minor failure."]
4487 UAVCAN_NODE_HEALTH_WARNING = 1,
4488 #[doc = "The node has encountered a major failure."]
4489 UAVCAN_NODE_HEALTH_ERROR = 2,
4490 #[doc = "The node has suffered a fatal malfunction."]
4491 UAVCAN_NODE_HEALTH_CRITICAL = 3,
4492}
4493impl UavcanNodeHealth {
4494 pub const DEFAULT: Self = Self::UAVCAN_NODE_HEALTH_OK;
4495}
4496impl Default for UavcanNodeHealth {
4497 fn default() -> Self {
4498 Self::DEFAULT
4499 }
4500}
4501#[cfg_attr(feature = "ts", derive(TS))]
4502#[cfg_attr(feature = "ts", ts(export))]
4503#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4504#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4505#[cfg_attr(feature = "serde", serde(tag = "type"))]
4506#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4507#[repr(u32)]
4508#[doc = "Generalized UAVCAN node mode"]
4509pub enum UavcanNodeMode {
4510 #[doc = "The node is performing its primary functions."]
4511 UAVCAN_NODE_MODE_OPERATIONAL = 0,
4512 #[doc = "The node is initializing; this mode is entered immediately after startup."]
4513 UAVCAN_NODE_MODE_INITIALIZATION = 1,
4514 #[doc = "The node is under maintenance."]
4515 UAVCAN_NODE_MODE_MAINTENANCE = 2,
4516 #[doc = "The node is in the process of updating its software."]
4517 UAVCAN_NODE_MODE_SOFTWARE_UPDATE = 3,
4518 #[doc = "The node is no longer available online."]
4519 UAVCAN_NODE_MODE_OFFLINE = 7,
4520}
4521impl UavcanNodeMode {
4522 pub const DEFAULT: Self = Self::UAVCAN_NODE_MODE_OPERATIONAL;
4523}
4524impl Default for UavcanNodeMode {
4525 fn default() -> Self {
4526 Self::DEFAULT
4527 }
4528}
4529bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for the global position report."] pub struct UtmDataAvailFlags : u8 { # [doc = "The field time contains valid data."] const UTM_DATA_AVAIL_FLAGS_TIME_VALID = 1 ; # [doc = "The field uas_id contains valid data."] const UTM_DATA_AVAIL_FLAGS_UAS_ID_AVAILABLE = 2 ; # [doc = "The fields lat, lon and h_acc contain valid data."] const UTM_DATA_AVAIL_FLAGS_POSITION_AVAILABLE = 4 ; # [doc = "The fields alt and v_acc contain valid data."] const UTM_DATA_AVAIL_FLAGS_ALTITUDE_AVAILABLE = 8 ; # [doc = "The field relative_alt contains valid data."] const UTM_DATA_AVAIL_FLAGS_RELATIVE_ALTITUDE_AVAILABLE = 16 ; # [doc = "The fields vx and vy contain valid data."] const UTM_DATA_AVAIL_FLAGS_HORIZONTAL_VELO_AVAILABLE = 32 ; # [doc = "The field vz contains valid data."] const UTM_DATA_AVAIL_FLAGS_VERTICAL_VELO_AVAILABLE = 64 ; # [doc = "The fields next_lat, next_lon and next_alt contain valid data."] const UTM_DATA_AVAIL_FLAGS_NEXT_WAYPOINT_AVAILABLE = 128 ; } }
4530impl UtmDataAvailFlags {
4531 pub const DEFAULT: Self = Self::UTM_DATA_AVAIL_FLAGS_TIME_VALID;
4532}
4533impl Default for UtmDataAvailFlags {
4534 fn default() -> Self {
4535 Self::DEFAULT
4536 }
4537}
4538#[cfg_attr(feature = "ts", derive(TS))]
4539#[cfg_attr(feature = "ts", ts(export))]
4540#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4541#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4542#[cfg_attr(feature = "serde", serde(tag = "type"))]
4543#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4544#[repr(u32)]
4545#[doc = "Airborne status of UAS."]
4546pub enum UtmFlightState {
4547 #[doc = "The flight state can't be determined."]
4548 UTM_FLIGHT_STATE_UNKNOWN = 1,
4549 #[doc = "UAS on ground."]
4550 UTM_FLIGHT_STATE_GROUND = 2,
4551 #[doc = "UAS airborne."]
4552 UTM_FLIGHT_STATE_AIRBORNE = 3,
4553 #[doc = "UAS is in an emergency flight state."]
4554 UTM_FLIGHT_STATE_EMERGENCY = 16,
4555 #[doc = "UAS has no active controls."]
4556 UTM_FLIGHT_STATE_NOCTRL = 32,
4557}
4558impl UtmFlightState {
4559 pub const DEFAULT: Self = Self::UTM_FLIGHT_STATE_UNKNOWN;
4560}
4561impl Default for UtmFlightState {
4562 fn default() -> Self {
4563 Self::DEFAULT
4564 }
4565}
4566#[cfg_attr(feature = "ts", derive(TS))]
4567#[cfg_attr(feature = "ts", ts(export))]
4568#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4569#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4570#[cfg_attr(feature = "serde", serde(tag = "type"))]
4571#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4572#[repr(u32)]
4573#[doc = "Video stream encodings"]
4574pub enum VideoStreamEncoding {
4575 #[doc = "Stream encoding is unknown"]
4576 VIDEO_STREAM_ENCODING_UNKNOWN = 0,
4577 #[doc = "Stream encoding is H.264"]
4578 VIDEO_STREAM_ENCODING_H264 = 1,
4579 #[doc = "Stream encoding is H.265"]
4580 VIDEO_STREAM_ENCODING_H265 = 2,
4581}
4582impl VideoStreamEncoding {
4583 pub const DEFAULT: Self = Self::VIDEO_STREAM_ENCODING_UNKNOWN;
4584}
4585impl Default for VideoStreamEncoding {
4586 fn default() -> Self {
4587 Self::DEFAULT
4588 }
4589}
4590bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Stream status flags (Bitmap)"] pub struct VideoStreamStatusFlags : u16 { # [doc = "Stream is active (running)"] const VIDEO_STREAM_STATUS_FLAGS_RUNNING = 1 ; # [doc = "Stream is thermal imaging"] const VIDEO_STREAM_STATUS_FLAGS_THERMAL = 2 ; # [doc = "Stream can report absolute thermal range (see CAMERA_THERMAL_RANGE)."] const VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED = 4 ; } }
4591impl VideoStreamStatusFlags {
4592 pub const DEFAULT: Self = Self::VIDEO_STREAM_STATUS_FLAGS_RUNNING;
4593}
4594impl Default for VideoStreamStatusFlags {
4595 fn default() -> Self {
4596 Self::DEFAULT
4597 }
4598}
4599#[cfg_attr(feature = "ts", derive(TS))]
4600#[cfg_attr(feature = "ts", ts(export))]
4601#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4602#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4603#[cfg_attr(feature = "serde", serde(tag = "type"))]
4604#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4605#[repr(u32)]
4606#[doc = "Video stream types"]
4607pub enum VideoStreamType {
4608 #[doc = "Stream is RTSP"]
4609 VIDEO_STREAM_TYPE_RTSP = 0,
4610 #[doc = "Stream is RTP UDP (URI gives the port number)"]
4611 VIDEO_STREAM_TYPE_RTPUDP = 1,
4612 #[doc = "Stream is MPEG on TCP"]
4613 VIDEO_STREAM_TYPE_TCP_MPEG = 2,
4614 #[doc = "Stream is MPEG TS (URI gives the port number)"]
4615 VIDEO_STREAM_TYPE_MPEG_TS = 3,
4616}
4617impl VideoStreamType {
4618 pub const DEFAULT: Self = Self::VIDEO_STREAM_TYPE_RTSP;
4619}
4620impl Default for VideoStreamType {
4621 fn default() -> Self {
4622 Self::DEFAULT
4623 }
4624}
4625#[cfg_attr(feature = "ts", derive(TS))]
4626#[cfg_attr(feature = "ts", ts(export))]
4627#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4628#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4629#[cfg_attr(feature = "serde", serde(tag = "type"))]
4630#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4631#[repr(u32)]
4632#[doc = "Direction of VTOL transition"]
4633pub enum VtolTransitionHeading {
4634 #[doc = "Respect the heading configuration of the vehicle."]
4635 VTOL_TRANSITION_HEADING_VEHICLE_DEFAULT = 0,
4636 #[doc = "Use the heading pointing towards the next waypoint."]
4637 VTOL_TRANSITION_HEADING_NEXT_WAYPOINT = 1,
4638 #[doc = "Use the heading on takeoff (while sitting on the ground)."]
4639 VTOL_TRANSITION_HEADING_TAKEOFF = 2,
4640 #[doc = "Use the specified heading in parameter 4."]
4641 VTOL_TRANSITION_HEADING_SPECIFIED = 3,
4642 #[doc = "Use the current heading when reaching takeoff altitude (potentially facing the wind when weather-vaning is active)."]
4643 VTOL_TRANSITION_HEADING_ANY = 4,
4644}
4645impl VtolTransitionHeading {
4646 pub const DEFAULT: Self = Self::VTOL_TRANSITION_HEADING_VEHICLE_DEFAULT;
4647}
4648impl Default for VtolTransitionHeading {
4649 fn default() -> Self {
4650 Self::DEFAULT
4651 }
4652}
4653#[cfg_attr(feature = "ts", derive(TS))]
4654#[cfg_attr(feature = "ts", ts(export))]
4655#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4656#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4657#[cfg_attr(feature = "serde", serde(tag = "type"))]
4658#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4659#[repr(u32)]
4660#[doc = "WiFi Mode."]
4661pub enum WifiConfigApMode {
4662 #[doc = "WiFi mode is undefined."]
4663 WIFI_CONFIG_AP_MODE_UNDEFINED = 0,
4664 #[doc = "WiFi configured as an access point."]
4665 WIFI_CONFIG_AP_MODE_AP = 1,
4666 #[doc = "WiFi configured as a station connected to an existing local WiFi network."]
4667 WIFI_CONFIG_AP_MODE_STATION = 2,
4668 #[doc = "WiFi disabled."]
4669 WIFI_CONFIG_AP_MODE_DISABLED = 3,
4670}
4671impl WifiConfigApMode {
4672 pub const DEFAULT: Self = Self::WIFI_CONFIG_AP_MODE_UNDEFINED;
4673}
4674impl Default for WifiConfigApMode {
4675 fn default() -> Self {
4676 Self::DEFAULT
4677 }
4678}
4679#[cfg_attr(feature = "ts", derive(TS))]
4680#[cfg_attr(feature = "ts", ts(export))]
4681#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4682#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4683#[cfg_attr(feature = "serde", serde(tag = "type"))]
4684#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4685#[repr(u32)]
4686#[doc = "Possible responses from a WIFI_CONFIG_AP message."]
4687pub enum WifiConfigApResponse {
4688 #[doc = "Undefined response. Likely an indicative of a system that doesn't support this request."]
4689 WIFI_CONFIG_AP_RESPONSE_UNDEFINED = 0,
4690 #[doc = "Changes accepted."]
4691 WIFI_CONFIG_AP_RESPONSE_ACCEPTED = 1,
4692 #[doc = "Changes rejected."]
4693 WIFI_CONFIG_AP_RESPONSE_REJECTED = 2,
4694 #[doc = "Invalid Mode."]
4695 WIFI_CONFIG_AP_RESPONSE_MODE_ERROR = 3,
4696 #[doc = "Invalid SSID."]
4697 WIFI_CONFIG_AP_RESPONSE_SSID_ERROR = 4,
4698 #[doc = "Invalid Password."]
4699 WIFI_CONFIG_AP_RESPONSE_PASSWORD_ERROR = 5,
4700}
4701impl WifiConfigApResponse {
4702 pub const DEFAULT: Self = Self::WIFI_CONFIG_AP_RESPONSE_UNDEFINED;
4703}
4704impl Default for WifiConfigApResponse {
4705 fn default() -> Self {
4706 Self::DEFAULT
4707 }
4708}
4709#[cfg_attr(feature = "ts", derive(TS))]
4710#[cfg_attr(feature = "ts", ts(export))]
4711#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4712#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4713#[cfg_attr(feature = "serde", serde(tag = "type"))]
4714#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4715#[repr(u32)]
4716#[doc = "Winch actions."]
4717pub enum WinchActions {
4718 #[doc = "Allow motor to freewheel."]
4719 WINCH_RELAXED = 0,
4720 #[doc = "Wind or unwind specified length of line, optionally using specified rate."]
4721 WINCH_RELATIVE_LENGTH_CONTROL = 1,
4722 #[doc = "Wind or unwind line at specified rate."]
4723 WINCH_RATE_CONTROL = 2,
4724 #[doc = "Perform the locking sequence to relieve motor while in the fully retracted position. Only action and instance command parameters are used, others are ignored."]
4725 WINCH_LOCK = 3,
4726 #[doc = "Sequence of drop, slow down, touch down, reel up, lock. Only action and instance command parameters are used, others are ignored."]
4727 WINCH_DELIVER = 4,
4728 #[doc = "Engage motor and hold current position. Only action and instance command parameters are used, others are ignored."]
4729 WINCH_HOLD = 5,
4730 #[doc = "Return the reel to the fully retracted position. Only action and instance command parameters are used, others are ignored."]
4731 WINCH_RETRACT = 6,
4732 #[doc = "Load the reel with line. The winch will calculate the total loaded length and stop when the tension exceeds a threshold. Only action and instance command parameters are used, others are ignored."]
4733 WINCH_LOAD_LINE = 7,
4734 #[doc = "Spool out the entire length of the line. Only action and instance command parameters are used, others are ignored."]
4735 WINCH_ABANDON_LINE = 8,
4736 #[doc = "Spools out just enough to present the hook to the user to load the payload. Only action and instance command parameters are used, others are ignored"]
4737 WINCH_LOAD_PAYLOAD = 9,
4738}
4739impl WinchActions {
4740 pub const DEFAULT: Self = Self::WINCH_RELAXED;
4741}
4742impl Default for WinchActions {
4743 fn default() -> Self {
4744 Self::DEFAULT
4745 }
4746}
4747#[doc = "Set the vehicle attitude and body angular rates."]
4748#[doc = ""]
4749#[doc = "ID: 140"]
4750#[derive(Debug, Clone, PartialEq)]
4751#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4752#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4753#[cfg_attr(feature = "ts", derive(TS))]
4754#[cfg_attr(feature = "ts", ts(export))]
4755pub struct ACTUATOR_CONTROL_TARGET_DATA {
4756 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
4757 pub time_usec: u64,
4758 #[doc = "Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs."]
4759 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4760 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
4761 pub controls: [f32; 8],
4762 #[doc = "Actuator group. The \"_mlx\" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances."]
4763 pub group_mlx: u8,
4764}
4765impl ACTUATOR_CONTROL_TARGET_DATA {
4766 pub const ENCODED_LEN: usize = 41usize;
4767 pub const DEFAULT: Self = Self {
4768 time_usec: 0_u64,
4769 controls: [0.0_f32; 8usize],
4770 group_mlx: 0_u8,
4771 };
4772 #[cfg(feature = "arbitrary")]
4773 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4774 use arbitrary::{Arbitrary, Unstructured};
4775 let mut buf = [0u8; 1024];
4776 rng.fill_bytes(&mut buf);
4777 let mut unstructured = Unstructured::new(&buf);
4778 Self::arbitrary(&mut unstructured).unwrap_or_default()
4779 }
4780}
4781impl Default for ACTUATOR_CONTROL_TARGET_DATA {
4782 fn default() -> Self {
4783 Self::DEFAULT.clone()
4784 }
4785}
4786impl MessageData for ACTUATOR_CONTROL_TARGET_DATA {
4787 type Message = MavMessage;
4788 const ID: u32 = 140u32;
4789 const NAME: &'static str = "ACTUATOR_CONTROL_TARGET";
4790 const EXTRA_CRC: u8 = 181u8;
4791 const ENCODED_LEN: usize = 41usize;
4792 fn deser(
4793 _version: MavlinkVersion,
4794 __input: &[u8],
4795 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4796 let avail_len = __input.len();
4797 let mut payload_buf = [0; Self::ENCODED_LEN];
4798 let mut buf = if avail_len < Self::ENCODED_LEN {
4799 payload_buf[0..avail_len].copy_from_slice(__input);
4800 Bytes::new(&payload_buf)
4801 } else {
4802 Bytes::new(__input)
4803 };
4804 let mut __struct = Self::default();
4805 __struct.time_usec = buf.get_u64_le();
4806 for v in &mut __struct.controls {
4807 let val = buf.get_f32_le();
4808 *v = val;
4809 }
4810 __struct.group_mlx = buf.get_u8();
4811 Ok(__struct)
4812 }
4813 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4814 let mut __tmp = BytesMut::new(bytes);
4815 #[allow(clippy::absurd_extreme_comparisons)]
4816 #[allow(unused_comparisons)]
4817 if __tmp.remaining() < Self::ENCODED_LEN {
4818 panic!(
4819 "buffer is too small (need {} bytes, but got {})",
4820 Self::ENCODED_LEN,
4821 __tmp.remaining(),
4822 )
4823 }
4824 __tmp.put_u64_le(self.time_usec);
4825 for val in &self.controls {
4826 __tmp.put_f32_le(*val);
4827 }
4828 __tmp.put_u8(self.group_mlx);
4829 if matches!(version, MavlinkVersion::V2) {
4830 let len = __tmp.len();
4831 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4832 } else {
4833 __tmp.len()
4834 }
4835 }
4836}
4837#[doc = "The raw values of the actuator outputs (e.g. on Pixhawk, from MAIN, AUX ports). This message supersedes SERVO_OUTPUT_RAW."]
4838#[doc = ""]
4839#[doc = "ID: 375"]
4840#[derive(Debug, Clone, PartialEq)]
4841#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4842#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4843#[cfg_attr(feature = "ts", derive(TS))]
4844#[cfg_attr(feature = "ts", ts(export))]
4845pub struct ACTUATOR_OUTPUT_STATUS_DATA {
4846 #[doc = "Timestamp (since system boot)."]
4847 pub time_usec: u64,
4848 #[doc = "Active outputs"]
4849 pub active: u32,
4850 #[doc = "Servo / motor output array values. Zero values indicate unused channels."]
4851 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4852 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
4853 pub actuator: [f32; 32],
4854}
4855impl ACTUATOR_OUTPUT_STATUS_DATA {
4856 pub const ENCODED_LEN: usize = 140usize;
4857 pub const DEFAULT: Self = Self {
4858 time_usec: 0_u64,
4859 active: 0_u32,
4860 actuator: [0.0_f32; 32usize],
4861 };
4862 #[cfg(feature = "arbitrary")]
4863 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4864 use arbitrary::{Arbitrary, Unstructured};
4865 let mut buf = [0u8; 1024];
4866 rng.fill_bytes(&mut buf);
4867 let mut unstructured = Unstructured::new(&buf);
4868 Self::arbitrary(&mut unstructured).unwrap_or_default()
4869 }
4870}
4871impl Default for ACTUATOR_OUTPUT_STATUS_DATA {
4872 fn default() -> Self {
4873 Self::DEFAULT.clone()
4874 }
4875}
4876impl MessageData for ACTUATOR_OUTPUT_STATUS_DATA {
4877 type Message = MavMessage;
4878 const ID: u32 = 375u32;
4879 const NAME: &'static str = "ACTUATOR_OUTPUT_STATUS";
4880 const EXTRA_CRC: u8 = 251u8;
4881 const ENCODED_LEN: usize = 140usize;
4882 fn deser(
4883 _version: MavlinkVersion,
4884 __input: &[u8],
4885 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4886 let avail_len = __input.len();
4887 let mut payload_buf = [0; Self::ENCODED_LEN];
4888 let mut buf = if avail_len < Self::ENCODED_LEN {
4889 payload_buf[0..avail_len].copy_from_slice(__input);
4890 Bytes::new(&payload_buf)
4891 } else {
4892 Bytes::new(__input)
4893 };
4894 let mut __struct = Self::default();
4895 __struct.time_usec = buf.get_u64_le();
4896 __struct.active = buf.get_u32_le();
4897 for v in &mut __struct.actuator {
4898 let val = buf.get_f32_le();
4899 *v = val;
4900 }
4901 Ok(__struct)
4902 }
4903 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4904 let mut __tmp = BytesMut::new(bytes);
4905 #[allow(clippy::absurd_extreme_comparisons)]
4906 #[allow(unused_comparisons)]
4907 if __tmp.remaining() < Self::ENCODED_LEN {
4908 panic!(
4909 "buffer is too small (need {} bytes, but got {})",
4910 Self::ENCODED_LEN,
4911 __tmp.remaining(),
4912 )
4913 }
4914 __tmp.put_u64_le(self.time_usec);
4915 __tmp.put_u32_le(self.active);
4916 for val in &self.actuator {
4917 __tmp.put_f32_le(*val);
4918 }
4919 if matches!(version, MavlinkVersion::V2) {
4920 let len = __tmp.len();
4921 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4922 } else {
4923 __tmp.len()
4924 }
4925 }
4926}
4927#[doc = "The location and information of an ADSB vehicle."]
4928#[doc = ""]
4929#[doc = "ID: 246"]
4930#[derive(Debug, Clone, PartialEq)]
4931#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4932#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4933#[cfg_attr(feature = "ts", derive(TS))]
4934#[cfg_attr(feature = "ts", ts(export))]
4935pub struct ADSB_VEHICLE_DATA {
4936 #[doc = "ICAO address"]
4937 pub ICAO_address: u32,
4938 #[doc = "Latitude"]
4939 pub lat: i32,
4940 #[doc = "Longitude"]
4941 pub lon: i32,
4942 #[doc = "Altitude(ASL)"]
4943 pub altitude: i32,
4944 #[doc = "Course over ground"]
4945 pub heading: u16,
4946 #[doc = "The horizontal velocity"]
4947 pub hor_velocity: u16,
4948 #[doc = "The vertical velocity. Positive is up"]
4949 pub ver_velocity: i16,
4950 #[doc = "Bitmap to indicate various statuses including valid data fields"]
4951 pub flags: AdsbFlags,
4952 #[doc = "Squawk code. Note that the code is in decimal: e.g. 7700 (general emergency) is encoded as binary 0b0001_1110_0001_0100, not(!) as 0b0000_111_111_000_000"]
4953 pub squawk: u16,
4954 #[doc = "ADSB altitude type."]
4955 pub altitude_type: AdsbAltitudeType,
4956 #[doc = "The callsign, 8+null"]
4957 #[cfg_attr(feature = "ts", ts(type = "string"))]
4958 pub callsign: CharArray<9>,
4959 #[doc = "ADSB emitter type."]
4960 pub emitter_type: AdsbEmitterType,
4961 #[doc = "Time since last communication in seconds"]
4962 pub tslc: u8,
4963}
4964impl ADSB_VEHICLE_DATA {
4965 pub const ENCODED_LEN: usize = 38usize;
4966 pub const DEFAULT: Self = Self {
4967 ICAO_address: 0_u32,
4968 lat: 0_i32,
4969 lon: 0_i32,
4970 altitude: 0_i32,
4971 heading: 0_u16,
4972 hor_velocity: 0_u16,
4973 ver_velocity: 0_i16,
4974 flags: AdsbFlags::DEFAULT,
4975 squawk: 0_u16,
4976 altitude_type: AdsbAltitudeType::DEFAULT,
4977 callsign: CharArray::new([0_u8; 9usize]),
4978 emitter_type: AdsbEmitterType::DEFAULT,
4979 tslc: 0_u8,
4980 };
4981 #[cfg(feature = "arbitrary")]
4982 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4983 use arbitrary::{Arbitrary, Unstructured};
4984 let mut buf = [0u8; 1024];
4985 rng.fill_bytes(&mut buf);
4986 let mut unstructured = Unstructured::new(&buf);
4987 Self::arbitrary(&mut unstructured).unwrap_or_default()
4988 }
4989}
4990impl Default for ADSB_VEHICLE_DATA {
4991 fn default() -> Self {
4992 Self::DEFAULT.clone()
4993 }
4994}
4995impl MessageData for ADSB_VEHICLE_DATA {
4996 type Message = MavMessage;
4997 const ID: u32 = 246u32;
4998 const NAME: &'static str = "ADSB_VEHICLE";
4999 const EXTRA_CRC: u8 = 184u8;
5000 const ENCODED_LEN: usize = 38usize;
5001 fn deser(
5002 _version: MavlinkVersion,
5003 __input: &[u8],
5004 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5005 let avail_len = __input.len();
5006 let mut payload_buf = [0; Self::ENCODED_LEN];
5007 let mut buf = if avail_len < Self::ENCODED_LEN {
5008 payload_buf[0..avail_len].copy_from_slice(__input);
5009 Bytes::new(&payload_buf)
5010 } else {
5011 Bytes::new(__input)
5012 };
5013 let mut __struct = Self::default();
5014 __struct.ICAO_address = buf.get_u32_le();
5015 __struct.lat = buf.get_i32_le();
5016 __struct.lon = buf.get_i32_le();
5017 __struct.altitude = buf.get_i32_le();
5018 __struct.heading = buf.get_u16_le();
5019 __struct.hor_velocity = buf.get_u16_le();
5020 __struct.ver_velocity = buf.get_i16_le();
5021 let tmp = buf.get_u16_le();
5022 __struct.flags =
5023 AdsbFlags::from_bits(tmp).ok_or(::mavlink_core::error::ParserError::InvalidFlag {
5024 flag_type: "AdsbFlags",
5025 value: tmp as u64,
5026 })?;
5027 __struct.squawk = buf.get_u16_le();
5028 let tmp = buf.get_u8();
5029 __struct.altitude_type =
5030 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
5031 enum_type: "AdsbAltitudeType",
5032 value: tmp as u64,
5033 })?;
5034 let mut tmp = [0_u8; 9usize];
5035 for v in &mut tmp {
5036 *v = buf.get_u8();
5037 }
5038 __struct.callsign = CharArray::new(tmp);
5039 let tmp = buf.get_u8();
5040 __struct.emitter_type =
5041 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
5042 enum_type: "AdsbEmitterType",
5043 value: tmp as u64,
5044 })?;
5045 __struct.tslc = buf.get_u8();
5046 Ok(__struct)
5047 }
5048 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5049 let mut __tmp = BytesMut::new(bytes);
5050 #[allow(clippy::absurd_extreme_comparisons)]
5051 #[allow(unused_comparisons)]
5052 if __tmp.remaining() < Self::ENCODED_LEN {
5053 panic!(
5054 "buffer is too small (need {} bytes, but got {})",
5055 Self::ENCODED_LEN,
5056 __tmp.remaining(),
5057 )
5058 }
5059 __tmp.put_u32_le(self.ICAO_address);
5060 __tmp.put_i32_le(self.lat);
5061 __tmp.put_i32_le(self.lon);
5062 __tmp.put_i32_le(self.altitude);
5063 __tmp.put_u16_le(self.heading);
5064 __tmp.put_u16_le(self.hor_velocity);
5065 __tmp.put_i16_le(self.ver_velocity);
5066 __tmp.put_u16_le(self.flags.bits());
5067 __tmp.put_u16_le(self.squawk);
5068 __tmp.put_u8(self.altitude_type as u8);
5069 for val in &self.callsign {
5070 __tmp.put_u8(*val);
5071 }
5072 __tmp.put_u8(self.emitter_type as u8);
5073 __tmp.put_u8(self.tslc);
5074 if matches!(version, MavlinkVersion::V2) {
5075 let len = __tmp.len();
5076 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5077 } else {
5078 __tmp.len()
5079 }
5080 }
5081}
5082#[doc = "The location and information of an AIS vessel."]
5083#[doc = ""]
5084#[doc = "ID: 301"]
5085#[derive(Debug, Clone, PartialEq)]
5086#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5087#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5088#[cfg_attr(feature = "ts", derive(TS))]
5089#[cfg_attr(feature = "ts", ts(export))]
5090pub struct AIS_VESSEL_DATA {
5091 #[doc = "Mobile Marine Service Identifier, 9 decimal digits"]
5092 pub MMSI: u32,
5093 #[doc = "Latitude"]
5094 pub lat: i32,
5095 #[doc = "Longitude"]
5096 pub lon: i32,
5097 #[doc = "Course over ground"]
5098 pub COG: u16,
5099 #[doc = "True heading"]
5100 pub heading: u16,
5101 #[doc = "Speed over ground"]
5102 pub velocity: u16,
5103 #[doc = "Distance from lat/lon location to bow"]
5104 pub dimension_bow: u16,
5105 #[doc = "Distance from lat/lon location to stern"]
5106 pub dimension_stern: u16,
5107 #[doc = "Time since last communication in seconds"]
5108 pub tslc: u16,
5109 #[doc = "Bitmask to indicate various statuses including valid data fields"]
5110 pub flags: AisFlags,
5111 #[doc = "Turn rate"]
5112 pub turn_rate: i8,
5113 #[doc = "Navigational status"]
5114 pub navigational_status: AisNavStatus,
5115 #[doc = "Type of vessels"]
5116 pub mavtype: AisType,
5117 #[doc = "Distance from lat/lon location to port side"]
5118 pub dimension_port: u8,
5119 #[doc = "Distance from lat/lon location to starboard side"]
5120 pub dimension_starboard: u8,
5121 #[doc = "The vessel callsign"]
5122 #[cfg_attr(feature = "ts", ts(type = "string"))]
5123 pub callsign: CharArray<7>,
5124 #[doc = "The vessel name"]
5125 #[cfg_attr(feature = "ts", ts(type = "string"))]
5126 pub name: CharArray<20>,
5127}
5128impl AIS_VESSEL_DATA {
5129 pub const ENCODED_LEN: usize = 58usize;
5130 pub const DEFAULT: Self = Self {
5131 MMSI: 0_u32,
5132 lat: 0_i32,
5133 lon: 0_i32,
5134 COG: 0_u16,
5135 heading: 0_u16,
5136 velocity: 0_u16,
5137 dimension_bow: 0_u16,
5138 dimension_stern: 0_u16,
5139 tslc: 0_u16,
5140 flags: AisFlags::DEFAULT,
5141 turn_rate: 0_i8,
5142 navigational_status: AisNavStatus::DEFAULT,
5143 mavtype: AisType::DEFAULT,
5144 dimension_port: 0_u8,
5145 dimension_starboard: 0_u8,
5146 callsign: CharArray::new([0_u8; 7usize]),
5147 name: CharArray::new([0_u8; 20usize]),
5148 };
5149 #[cfg(feature = "arbitrary")]
5150 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5151 use arbitrary::{Arbitrary, Unstructured};
5152 let mut buf = [0u8; 1024];
5153 rng.fill_bytes(&mut buf);
5154 let mut unstructured = Unstructured::new(&buf);
5155 Self::arbitrary(&mut unstructured).unwrap_or_default()
5156 }
5157}
5158impl Default for AIS_VESSEL_DATA {
5159 fn default() -> Self {
5160 Self::DEFAULT.clone()
5161 }
5162}
5163impl MessageData for AIS_VESSEL_DATA {
5164 type Message = MavMessage;
5165 const ID: u32 = 301u32;
5166 const NAME: &'static str = "AIS_VESSEL";
5167 const EXTRA_CRC: u8 = 243u8;
5168 const ENCODED_LEN: usize = 58usize;
5169 fn deser(
5170 _version: MavlinkVersion,
5171 __input: &[u8],
5172 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5173 let avail_len = __input.len();
5174 let mut payload_buf = [0; Self::ENCODED_LEN];
5175 let mut buf = if avail_len < Self::ENCODED_LEN {
5176 payload_buf[0..avail_len].copy_from_slice(__input);
5177 Bytes::new(&payload_buf)
5178 } else {
5179 Bytes::new(__input)
5180 };
5181 let mut __struct = Self::default();
5182 __struct.MMSI = buf.get_u32_le();
5183 __struct.lat = buf.get_i32_le();
5184 __struct.lon = buf.get_i32_le();
5185 __struct.COG = buf.get_u16_le();
5186 __struct.heading = buf.get_u16_le();
5187 __struct.velocity = buf.get_u16_le();
5188 __struct.dimension_bow = buf.get_u16_le();
5189 __struct.dimension_stern = buf.get_u16_le();
5190 __struct.tslc = buf.get_u16_le();
5191 let tmp = buf.get_u16_le();
5192 __struct.flags =
5193 AisFlags::from_bits(tmp).ok_or(::mavlink_core::error::ParserError::InvalidFlag {
5194 flag_type: "AisFlags",
5195 value: tmp as u64,
5196 })?;
5197 __struct.turn_rate = buf.get_i8();
5198 let tmp = buf.get_u8();
5199 __struct.navigational_status =
5200 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
5201 enum_type: "AisNavStatus",
5202 value: tmp as u64,
5203 })?;
5204 let tmp = buf.get_u8();
5205 __struct.mavtype =
5206 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
5207 enum_type: "AisType",
5208 value: tmp as u64,
5209 })?;
5210 __struct.dimension_port = buf.get_u8();
5211 __struct.dimension_starboard = buf.get_u8();
5212 let mut tmp = [0_u8; 7usize];
5213 for v in &mut tmp {
5214 *v = buf.get_u8();
5215 }
5216 __struct.callsign = CharArray::new(tmp);
5217 let mut tmp = [0_u8; 20usize];
5218 for v in &mut tmp {
5219 *v = buf.get_u8();
5220 }
5221 __struct.name = CharArray::new(tmp);
5222 Ok(__struct)
5223 }
5224 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5225 let mut __tmp = BytesMut::new(bytes);
5226 #[allow(clippy::absurd_extreme_comparisons)]
5227 #[allow(unused_comparisons)]
5228 if __tmp.remaining() < Self::ENCODED_LEN {
5229 panic!(
5230 "buffer is too small (need {} bytes, but got {})",
5231 Self::ENCODED_LEN,
5232 __tmp.remaining(),
5233 )
5234 }
5235 __tmp.put_u32_le(self.MMSI);
5236 __tmp.put_i32_le(self.lat);
5237 __tmp.put_i32_le(self.lon);
5238 __tmp.put_u16_le(self.COG);
5239 __tmp.put_u16_le(self.heading);
5240 __tmp.put_u16_le(self.velocity);
5241 __tmp.put_u16_le(self.dimension_bow);
5242 __tmp.put_u16_le(self.dimension_stern);
5243 __tmp.put_u16_le(self.tslc);
5244 __tmp.put_u16_le(self.flags.bits());
5245 __tmp.put_i8(self.turn_rate);
5246 __tmp.put_u8(self.navigational_status as u8);
5247 __tmp.put_u8(self.mavtype as u8);
5248 __tmp.put_u8(self.dimension_port);
5249 __tmp.put_u8(self.dimension_starboard);
5250 for val in &self.callsign {
5251 __tmp.put_u8(*val);
5252 }
5253 for val in &self.name {
5254 __tmp.put_u8(*val);
5255 }
5256 if matches!(version, MavlinkVersion::V2) {
5257 let len = __tmp.len();
5258 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5259 } else {
5260 __tmp.len()
5261 }
5262 }
5263}
5264#[doc = "The current system altitude."]
5265#[doc = ""]
5266#[doc = "ID: 141"]
5267#[derive(Debug, Clone, PartialEq)]
5268#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5269#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5270#[cfg_attr(feature = "ts", derive(TS))]
5271#[cfg_attr(feature = "ts", ts(export))]
5272pub struct ALTITUDE_DATA {
5273 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
5274 pub time_usec: u64,
5275 #[doc = "This altitude measure is initialized on system boot and monotonic (it is never reset, but represents the local altitude change). The only guarantee on this field is that it will never be reset and is consistent within a flight. The recommended value for this field is the uncorrected barometric altitude at boot time. This altitude will also drift and vary between flights."]
5276 pub altitude_monotonic: f32,
5277 #[doc = "This altitude measure is strictly above mean sea level and might be non-monotonic (it might reset on events like GPS lock or when a new QNH value is set). It should be the altitude to which global altitude waypoints are compared to. Note that it is *not* the GPS altitude, however, most GPS modules already output MSL by default and not the WGS84 altitude."]
5278 pub altitude_amsl: f32,
5279 #[doc = "This is the local altitude in the local coordinate frame. It is not the altitude above home, but in reference to the coordinate origin (0, 0, 0). It is up-positive."]
5280 pub altitude_local: f32,
5281 #[doc = "This is the altitude above the home position. It resets on each change of the current home position."]
5282 pub altitude_relative: f32,
5283 #[doc = "This is the altitude above terrain. It might be fed by a terrain database or an altimeter. Values smaller than -1000 should be interpreted as unknown."]
5284 pub altitude_terrain: f32,
5285 #[doc = "This is not the altitude, but the clear space below the system according to the fused clearance estimate. It generally should max out at the maximum range of e.g. the laser altimeter. It is generally a moving target. A negative value indicates no measurement available."]
5286 pub bottom_clearance: f32,
5287}
5288impl ALTITUDE_DATA {
5289 pub const ENCODED_LEN: usize = 32usize;
5290 pub const DEFAULT: Self = Self {
5291 time_usec: 0_u64,
5292 altitude_monotonic: 0.0_f32,
5293 altitude_amsl: 0.0_f32,
5294 altitude_local: 0.0_f32,
5295 altitude_relative: 0.0_f32,
5296 altitude_terrain: 0.0_f32,
5297 bottom_clearance: 0.0_f32,
5298 };
5299 #[cfg(feature = "arbitrary")]
5300 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5301 use arbitrary::{Arbitrary, Unstructured};
5302 let mut buf = [0u8; 1024];
5303 rng.fill_bytes(&mut buf);
5304 let mut unstructured = Unstructured::new(&buf);
5305 Self::arbitrary(&mut unstructured).unwrap_or_default()
5306 }
5307}
5308impl Default for ALTITUDE_DATA {
5309 fn default() -> Self {
5310 Self::DEFAULT.clone()
5311 }
5312}
5313impl MessageData for ALTITUDE_DATA {
5314 type Message = MavMessage;
5315 const ID: u32 = 141u32;
5316 const NAME: &'static str = "ALTITUDE";
5317 const EXTRA_CRC: u8 = 47u8;
5318 const ENCODED_LEN: usize = 32usize;
5319 fn deser(
5320 _version: MavlinkVersion,
5321 __input: &[u8],
5322 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5323 let avail_len = __input.len();
5324 let mut payload_buf = [0; Self::ENCODED_LEN];
5325 let mut buf = if avail_len < Self::ENCODED_LEN {
5326 payload_buf[0..avail_len].copy_from_slice(__input);
5327 Bytes::new(&payload_buf)
5328 } else {
5329 Bytes::new(__input)
5330 };
5331 let mut __struct = Self::default();
5332 __struct.time_usec = buf.get_u64_le();
5333 __struct.altitude_monotonic = buf.get_f32_le();
5334 __struct.altitude_amsl = buf.get_f32_le();
5335 __struct.altitude_local = buf.get_f32_le();
5336 __struct.altitude_relative = buf.get_f32_le();
5337 __struct.altitude_terrain = buf.get_f32_le();
5338 __struct.bottom_clearance = buf.get_f32_le();
5339 Ok(__struct)
5340 }
5341 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5342 let mut __tmp = BytesMut::new(bytes);
5343 #[allow(clippy::absurd_extreme_comparisons)]
5344 #[allow(unused_comparisons)]
5345 if __tmp.remaining() < Self::ENCODED_LEN {
5346 panic!(
5347 "buffer is too small (need {} bytes, but got {})",
5348 Self::ENCODED_LEN,
5349 __tmp.remaining(),
5350 )
5351 }
5352 __tmp.put_u64_le(self.time_usec);
5353 __tmp.put_f32_le(self.altitude_monotonic);
5354 __tmp.put_f32_le(self.altitude_amsl);
5355 __tmp.put_f32_le(self.altitude_local);
5356 __tmp.put_f32_le(self.altitude_relative);
5357 __tmp.put_f32_le(self.altitude_terrain);
5358 __tmp.put_f32_le(self.bottom_clearance);
5359 if matches!(version, MavlinkVersion::V2) {
5360 let len = __tmp.len();
5361 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5362 } else {
5363 __tmp.len()
5364 }
5365 }
5366}
5367#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, Y-right, X-front, ZYX, intrinsic)."]
5368#[doc = ""]
5369#[doc = "ID: 30"]
5370#[derive(Debug, Clone, PartialEq)]
5371#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5372#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5373#[cfg_attr(feature = "ts", derive(TS))]
5374#[cfg_attr(feature = "ts", ts(export))]
5375pub struct ATTITUDE_DATA {
5376 #[doc = "Timestamp (time since system boot)."]
5377 pub time_boot_ms: u32,
5378 #[doc = "Roll angle (-pi..+pi)"]
5379 pub roll: f32,
5380 #[doc = "Pitch angle (-pi..+pi)"]
5381 pub pitch: f32,
5382 #[doc = "Yaw angle (-pi..+pi)"]
5383 pub yaw: f32,
5384 #[doc = "Roll angular speed"]
5385 pub rollspeed: f32,
5386 #[doc = "Pitch angular speed"]
5387 pub pitchspeed: f32,
5388 #[doc = "Yaw angular speed"]
5389 pub yawspeed: f32,
5390}
5391impl ATTITUDE_DATA {
5392 pub const ENCODED_LEN: usize = 28usize;
5393 pub const DEFAULT: Self = Self {
5394 time_boot_ms: 0_u32,
5395 roll: 0.0_f32,
5396 pitch: 0.0_f32,
5397 yaw: 0.0_f32,
5398 rollspeed: 0.0_f32,
5399 pitchspeed: 0.0_f32,
5400 yawspeed: 0.0_f32,
5401 };
5402 #[cfg(feature = "arbitrary")]
5403 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5404 use arbitrary::{Arbitrary, Unstructured};
5405 let mut buf = [0u8; 1024];
5406 rng.fill_bytes(&mut buf);
5407 let mut unstructured = Unstructured::new(&buf);
5408 Self::arbitrary(&mut unstructured).unwrap_or_default()
5409 }
5410}
5411impl Default for ATTITUDE_DATA {
5412 fn default() -> Self {
5413 Self::DEFAULT.clone()
5414 }
5415}
5416impl MessageData for ATTITUDE_DATA {
5417 type Message = MavMessage;
5418 const ID: u32 = 30u32;
5419 const NAME: &'static str = "ATTITUDE";
5420 const EXTRA_CRC: u8 = 39u8;
5421 const ENCODED_LEN: usize = 28usize;
5422 fn deser(
5423 _version: MavlinkVersion,
5424 __input: &[u8],
5425 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5426 let avail_len = __input.len();
5427 let mut payload_buf = [0; Self::ENCODED_LEN];
5428 let mut buf = if avail_len < Self::ENCODED_LEN {
5429 payload_buf[0..avail_len].copy_from_slice(__input);
5430 Bytes::new(&payload_buf)
5431 } else {
5432 Bytes::new(__input)
5433 };
5434 let mut __struct = Self::default();
5435 __struct.time_boot_ms = buf.get_u32_le();
5436 __struct.roll = buf.get_f32_le();
5437 __struct.pitch = buf.get_f32_le();
5438 __struct.yaw = buf.get_f32_le();
5439 __struct.rollspeed = buf.get_f32_le();
5440 __struct.pitchspeed = buf.get_f32_le();
5441 __struct.yawspeed = buf.get_f32_le();
5442 Ok(__struct)
5443 }
5444 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5445 let mut __tmp = BytesMut::new(bytes);
5446 #[allow(clippy::absurd_extreme_comparisons)]
5447 #[allow(unused_comparisons)]
5448 if __tmp.remaining() < Self::ENCODED_LEN {
5449 panic!(
5450 "buffer is too small (need {} bytes, but got {})",
5451 Self::ENCODED_LEN,
5452 __tmp.remaining(),
5453 )
5454 }
5455 __tmp.put_u32_le(self.time_boot_ms);
5456 __tmp.put_f32_le(self.roll);
5457 __tmp.put_f32_le(self.pitch);
5458 __tmp.put_f32_le(self.yaw);
5459 __tmp.put_f32_le(self.rollspeed);
5460 __tmp.put_f32_le(self.pitchspeed);
5461 __tmp.put_f32_le(self.yawspeed);
5462 if matches!(version, MavlinkVersion::V2) {
5463 let len = __tmp.len();
5464 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5465 } else {
5466 __tmp.len()
5467 }
5468 }
5469}
5470#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
5471#[doc = ""]
5472#[doc = "ID: 31"]
5473#[derive(Debug, Clone, PartialEq)]
5474#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5475#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5476#[cfg_attr(feature = "ts", derive(TS))]
5477#[cfg_attr(feature = "ts", ts(export))]
5478pub struct ATTITUDE_QUATERNION_DATA {
5479 #[doc = "Timestamp (time since system boot)."]
5480 pub time_boot_ms: u32,
5481 #[doc = "Quaternion component 1, w (1 in null-rotation)"]
5482 pub q1: f32,
5483 #[doc = "Quaternion component 2, x (0 in null-rotation)"]
5484 pub q2: f32,
5485 #[doc = "Quaternion component 3, y (0 in null-rotation)"]
5486 pub q3: f32,
5487 #[doc = "Quaternion component 4, z (0 in null-rotation)"]
5488 pub q4: f32,
5489 #[doc = "Roll angular speed"]
5490 pub rollspeed: f32,
5491 #[doc = "Pitch angular speed"]
5492 pub pitchspeed: f32,
5493 #[doc = "Yaw angular speed"]
5494 pub yawspeed: f32,
5495 #[doc = "Rotation offset by which the attitude quaternion and angular speed vector should be rotated for user display (quaternion with [w, x, y, z] order, zero-rotation is [1, 0, 0, 0], send [0, 0, 0, 0] if field not supported). This field is intended for systems in which the reference attitude may change during flight. For example, tailsitters VTOLs rotate their reference attitude by 90 degrees between hover mode and fixed wing mode, thus repr_offset_q is equal to [1, 0, 0, 0] in hover mode and equal to [0.7071, 0, 0.7071, 0] in fixed wing mode."]
5496 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5497 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5498 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5499 pub repr_offset_q: [f32; 4],
5500}
5501impl ATTITUDE_QUATERNION_DATA {
5502 pub const ENCODED_LEN: usize = 48usize;
5503 pub const DEFAULT: Self = Self {
5504 time_boot_ms: 0_u32,
5505 q1: 0.0_f32,
5506 q2: 0.0_f32,
5507 q3: 0.0_f32,
5508 q4: 0.0_f32,
5509 rollspeed: 0.0_f32,
5510 pitchspeed: 0.0_f32,
5511 yawspeed: 0.0_f32,
5512 repr_offset_q: [0.0_f32; 4usize],
5513 };
5514 #[cfg(feature = "arbitrary")]
5515 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5516 use arbitrary::{Arbitrary, Unstructured};
5517 let mut buf = [0u8; 1024];
5518 rng.fill_bytes(&mut buf);
5519 let mut unstructured = Unstructured::new(&buf);
5520 Self::arbitrary(&mut unstructured).unwrap_or_default()
5521 }
5522}
5523impl Default for ATTITUDE_QUATERNION_DATA {
5524 fn default() -> Self {
5525 Self::DEFAULT.clone()
5526 }
5527}
5528impl MessageData for ATTITUDE_QUATERNION_DATA {
5529 type Message = MavMessage;
5530 const ID: u32 = 31u32;
5531 const NAME: &'static str = "ATTITUDE_QUATERNION";
5532 const EXTRA_CRC: u8 = 246u8;
5533 const ENCODED_LEN: usize = 48usize;
5534 fn deser(
5535 _version: MavlinkVersion,
5536 __input: &[u8],
5537 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5538 let avail_len = __input.len();
5539 let mut payload_buf = [0; Self::ENCODED_LEN];
5540 let mut buf = if avail_len < Self::ENCODED_LEN {
5541 payload_buf[0..avail_len].copy_from_slice(__input);
5542 Bytes::new(&payload_buf)
5543 } else {
5544 Bytes::new(__input)
5545 };
5546 let mut __struct = Self::default();
5547 __struct.time_boot_ms = buf.get_u32_le();
5548 __struct.q1 = buf.get_f32_le();
5549 __struct.q2 = buf.get_f32_le();
5550 __struct.q3 = buf.get_f32_le();
5551 __struct.q4 = buf.get_f32_le();
5552 __struct.rollspeed = buf.get_f32_le();
5553 __struct.pitchspeed = buf.get_f32_le();
5554 __struct.yawspeed = buf.get_f32_le();
5555 for v in &mut __struct.repr_offset_q {
5556 let val = buf.get_f32_le();
5557 *v = val;
5558 }
5559 Ok(__struct)
5560 }
5561 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5562 let mut __tmp = BytesMut::new(bytes);
5563 #[allow(clippy::absurd_extreme_comparisons)]
5564 #[allow(unused_comparisons)]
5565 if __tmp.remaining() < Self::ENCODED_LEN {
5566 panic!(
5567 "buffer is too small (need {} bytes, but got {})",
5568 Self::ENCODED_LEN,
5569 __tmp.remaining(),
5570 )
5571 }
5572 __tmp.put_u32_le(self.time_boot_ms);
5573 __tmp.put_f32_le(self.q1);
5574 __tmp.put_f32_le(self.q2);
5575 __tmp.put_f32_le(self.q3);
5576 __tmp.put_f32_le(self.q4);
5577 __tmp.put_f32_le(self.rollspeed);
5578 __tmp.put_f32_le(self.pitchspeed);
5579 __tmp.put_f32_le(self.yawspeed);
5580 if matches!(version, MavlinkVersion::V2) {
5581 for val in &self.repr_offset_q {
5582 __tmp.put_f32_le(*val);
5583 }
5584 let len = __tmp.len();
5585 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5586 } else {
5587 __tmp.len()
5588 }
5589 }
5590}
5591#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
5592#[doc = ""]
5593#[doc = "ID: 61"]
5594#[derive(Debug, Clone, PartialEq)]
5595#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5596#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5597#[cfg_attr(feature = "ts", derive(TS))]
5598#[cfg_attr(feature = "ts", ts(export))]
5599pub struct ATTITUDE_QUATERNION_COV_DATA {
5600 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
5601 pub time_usec: u64,
5602 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)"]
5603 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5604 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5605 pub q: [f32; 4],
5606 #[doc = "Roll angular speed"]
5607 pub rollspeed: f32,
5608 #[doc = "Pitch angular speed"]
5609 pub pitchspeed: f32,
5610 #[doc = "Yaw angular speed"]
5611 pub yawspeed: f32,
5612 #[doc = "Row-major representation of a 3x3 attitude covariance matrix (states: roll, pitch, yaw; first three entries are the first ROW, next three entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
5613 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5614 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5615 pub covariance: [f32; 9],
5616}
5617impl ATTITUDE_QUATERNION_COV_DATA {
5618 pub const ENCODED_LEN: usize = 72usize;
5619 pub const DEFAULT: Self = Self {
5620 time_usec: 0_u64,
5621 q: [0.0_f32; 4usize],
5622 rollspeed: 0.0_f32,
5623 pitchspeed: 0.0_f32,
5624 yawspeed: 0.0_f32,
5625 covariance: [0.0_f32; 9usize],
5626 };
5627 #[cfg(feature = "arbitrary")]
5628 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5629 use arbitrary::{Arbitrary, Unstructured};
5630 let mut buf = [0u8; 1024];
5631 rng.fill_bytes(&mut buf);
5632 let mut unstructured = Unstructured::new(&buf);
5633 Self::arbitrary(&mut unstructured).unwrap_or_default()
5634 }
5635}
5636impl Default for ATTITUDE_QUATERNION_COV_DATA {
5637 fn default() -> Self {
5638 Self::DEFAULT.clone()
5639 }
5640}
5641impl MessageData for ATTITUDE_QUATERNION_COV_DATA {
5642 type Message = MavMessage;
5643 const ID: u32 = 61u32;
5644 const NAME: &'static str = "ATTITUDE_QUATERNION_COV";
5645 const EXTRA_CRC: u8 = 167u8;
5646 const ENCODED_LEN: usize = 72usize;
5647 fn deser(
5648 _version: MavlinkVersion,
5649 __input: &[u8],
5650 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5651 let avail_len = __input.len();
5652 let mut payload_buf = [0; Self::ENCODED_LEN];
5653 let mut buf = if avail_len < Self::ENCODED_LEN {
5654 payload_buf[0..avail_len].copy_from_slice(__input);
5655 Bytes::new(&payload_buf)
5656 } else {
5657 Bytes::new(__input)
5658 };
5659 let mut __struct = Self::default();
5660 __struct.time_usec = buf.get_u64_le();
5661 for v in &mut __struct.q {
5662 let val = buf.get_f32_le();
5663 *v = val;
5664 }
5665 __struct.rollspeed = buf.get_f32_le();
5666 __struct.pitchspeed = buf.get_f32_le();
5667 __struct.yawspeed = buf.get_f32_le();
5668 for v in &mut __struct.covariance {
5669 let val = buf.get_f32_le();
5670 *v = val;
5671 }
5672 Ok(__struct)
5673 }
5674 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5675 let mut __tmp = BytesMut::new(bytes);
5676 #[allow(clippy::absurd_extreme_comparisons)]
5677 #[allow(unused_comparisons)]
5678 if __tmp.remaining() < Self::ENCODED_LEN {
5679 panic!(
5680 "buffer is too small (need {} bytes, but got {})",
5681 Self::ENCODED_LEN,
5682 __tmp.remaining(),
5683 )
5684 }
5685 __tmp.put_u64_le(self.time_usec);
5686 for val in &self.q {
5687 __tmp.put_f32_le(*val);
5688 }
5689 __tmp.put_f32_le(self.rollspeed);
5690 __tmp.put_f32_le(self.pitchspeed);
5691 __tmp.put_f32_le(self.yawspeed);
5692 for val in &self.covariance {
5693 __tmp.put_f32_le(*val);
5694 }
5695 if matches!(version, MavlinkVersion::V2) {
5696 let len = __tmp.len();
5697 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5698 } else {
5699 __tmp.len()
5700 }
5701 }
5702}
5703#[doc = "Reports the current commanded attitude of the vehicle as specified by the autopilot. This should match the commands sent in a SET_ATTITUDE_TARGET message if the vehicle is being controlled this way."]
5704#[doc = ""]
5705#[doc = "ID: 83"]
5706#[derive(Debug, Clone, PartialEq)]
5707#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5708#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5709#[cfg_attr(feature = "ts", derive(TS))]
5710#[cfg_attr(feature = "ts", ts(export))]
5711pub struct ATTITUDE_TARGET_DATA {
5712 #[doc = "Timestamp (time since system boot)."]
5713 pub time_boot_ms: u32,
5714 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
5715 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5716 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5717 pub q: [f32; 4],
5718 #[doc = "Body roll rate"]
5719 pub body_roll_rate: f32,
5720 #[doc = "Body pitch rate"]
5721 pub body_pitch_rate: f32,
5722 #[doc = "Body yaw rate"]
5723 pub body_yaw_rate: f32,
5724 #[doc = "Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)"]
5725 pub thrust: f32,
5726 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
5727 pub type_mask: AttitudeTargetTypemask,
5728}
5729impl ATTITUDE_TARGET_DATA {
5730 pub const ENCODED_LEN: usize = 37usize;
5731 pub const DEFAULT: Self = Self {
5732 time_boot_ms: 0_u32,
5733 q: [0.0_f32; 4usize],
5734 body_roll_rate: 0.0_f32,
5735 body_pitch_rate: 0.0_f32,
5736 body_yaw_rate: 0.0_f32,
5737 thrust: 0.0_f32,
5738 type_mask: AttitudeTargetTypemask::DEFAULT,
5739 };
5740 #[cfg(feature = "arbitrary")]
5741 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5742 use arbitrary::{Arbitrary, Unstructured};
5743 let mut buf = [0u8; 1024];
5744 rng.fill_bytes(&mut buf);
5745 let mut unstructured = Unstructured::new(&buf);
5746 Self::arbitrary(&mut unstructured).unwrap_or_default()
5747 }
5748}
5749impl Default for ATTITUDE_TARGET_DATA {
5750 fn default() -> Self {
5751 Self::DEFAULT.clone()
5752 }
5753}
5754impl MessageData for ATTITUDE_TARGET_DATA {
5755 type Message = MavMessage;
5756 const ID: u32 = 83u32;
5757 const NAME: &'static str = "ATTITUDE_TARGET";
5758 const EXTRA_CRC: u8 = 22u8;
5759 const ENCODED_LEN: usize = 37usize;
5760 fn deser(
5761 _version: MavlinkVersion,
5762 __input: &[u8],
5763 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5764 let avail_len = __input.len();
5765 let mut payload_buf = [0; Self::ENCODED_LEN];
5766 let mut buf = if avail_len < Self::ENCODED_LEN {
5767 payload_buf[0..avail_len].copy_from_slice(__input);
5768 Bytes::new(&payload_buf)
5769 } else {
5770 Bytes::new(__input)
5771 };
5772 let mut __struct = Self::default();
5773 __struct.time_boot_ms = buf.get_u32_le();
5774 for v in &mut __struct.q {
5775 let val = buf.get_f32_le();
5776 *v = val;
5777 }
5778 __struct.body_roll_rate = buf.get_f32_le();
5779 __struct.body_pitch_rate = buf.get_f32_le();
5780 __struct.body_yaw_rate = buf.get_f32_le();
5781 __struct.thrust = buf.get_f32_le();
5782 let tmp = buf.get_u8();
5783 __struct.type_mask = AttitudeTargetTypemask::from_bits(tmp).ok_or(
5784 ::mavlink_core::error::ParserError::InvalidFlag {
5785 flag_type: "AttitudeTargetTypemask",
5786 value: tmp as u64,
5787 },
5788 )?;
5789 Ok(__struct)
5790 }
5791 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5792 let mut __tmp = BytesMut::new(bytes);
5793 #[allow(clippy::absurd_extreme_comparisons)]
5794 #[allow(unused_comparisons)]
5795 if __tmp.remaining() < Self::ENCODED_LEN {
5796 panic!(
5797 "buffer is too small (need {} bytes, but got {})",
5798 Self::ENCODED_LEN,
5799 __tmp.remaining(),
5800 )
5801 }
5802 __tmp.put_u32_le(self.time_boot_ms);
5803 for val in &self.q {
5804 __tmp.put_f32_le(*val);
5805 }
5806 __tmp.put_f32_le(self.body_roll_rate);
5807 __tmp.put_f32_le(self.body_pitch_rate);
5808 __tmp.put_f32_le(self.body_yaw_rate);
5809 __tmp.put_f32_le(self.thrust);
5810 __tmp.put_u8(self.type_mask.bits());
5811 if matches!(version, MavlinkVersion::V2) {
5812 let len = __tmp.len();
5813 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5814 } else {
5815 __tmp.len()
5816 }
5817 }
5818}
5819#[doc = "Motion capture attitude and position."]
5820#[doc = ""]
5821#[doc = "ID: 138"]
5822#[derive(Debug, Clone, PartialEq)]
5823#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5824#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5825#[cfg_attr(feature = "ts", derive(TS))]
5826#[cfg_attr(feature = "ts", ts(export))]
5827pub struct ATT_POS_MOCAP_DATA {
5828 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
5829 pub time_usec: u64,
5830 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
5831 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5832 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5833 pub q: [f32; 4],
5834 #[doc = "X position (NED)"]
5835 pub x: f32,
5836 #[doc = "Y position (NED)"]
5837 pub y: f32,
5838 #[doc = "Z position (NED)"]
5839 pub z: f32,
5840 #[doc = "Row-major representation of a pose 6x6 cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
5841 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5842 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5843 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5844 pub covariance: [f32; 21],
5845}
5846impl ATT_POS_MOCAP_DATA {
5847 pub const ENCODED_LEN: usize = 120usize;
5848 pub const DEFAULT: Self = Self {
5849 time_usec: 0_u64,
5850 q: [0.0_f32; 4usize],
5851 x: 0.0_f32,
5852 y: 0.0_f32,
5853 z: 0.0_f32,
5854 covariance: [0.0_f32; 21usize],
5855 };
5856 #[cfg(feature = "arbitrary")]
5857 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5858 use arbitrary::{Arbitrary, Unstructured};
5859 let mut buf = [0u8; 1024];
5860 rng.fill_bytes(&mut buf);
5861 let mut unstructured = Unstructured::new(&buf);
5862 Self::arbitrary(&mut unstructured).unwrap_or_default()
5863 }
5864}
5865impl Default for ATT_POS_MOCAP_DATA {
5866 fn default() -> Self {
5867 Self::DEFAULT.clone()
5868 }
5869}
5870impl MessageData for ATT_POS_MOCAP_DATA {
5871 type Message = MavMessage;
5872 const ID: u32 = 138u32;
5873 const NAME: &'static str = "ATT_POS_MOCAP";
5874 const EXTRA_CRC: u8 = 109u8;
5875 const ENCODED_LEN: usize = 120usize;
5876 fn deser(
5877 _version: MavlinkVersion,
5878 __input: &[u8],
5879 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5880 let avail_len = __input.len();
5881 let mut payload_buf = [0; Self::ENCODED_LEN];
5882 let mut buf = if avail_len < Self::ENCODED_LEN {
5883 payload_buf[0..avail_len].copy_from_slice(__input);
5884 Bytes::new(&payload_buf)
5885 } else {
5886 Bytes::new(__input)
5887 };
5888 let mut __struct = Self::default();
5889 __struct.time_usec = buf.get_u64_le();
5890 for v in &mut __struct.q {
5891 let val = buf.get_f32_le();
5892 *v = val;
5893 }
5894 __struct.x = buf.get_f32_le();
5895 __struct.y = buf.get_f32_le();
5896 __struct.z = buf.get_f32_le();
5897 for v in &mut __struct.covariance {
5898 let val = buf.get_f32_le();
5899 *v = val;
5900 }
5901 Ok(__struct)
5902 }
5903 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5904 let mut __tmp = BytesMut::new(bytes);
5905 #[allow(clippy::absurd_extreme_comparisons)]
5906 #[allow(unused_comparisons)]
5907 if __tmp.remaining() < Self::ENCODED_LEN {
5908 panic!(
5909 "buffer is too small (need {} bytes, but got {})",
5910 Self::ENCODED_LEN,
5911 __tmp.remaining(),
5912 )
5913 }
5914 __tmp.put_u64_le(self.time_usec);
5915 for val in &self.q {
5916 __tmp.put_f32_le(*val);
5917 }
5918 __tmp.put_f32_le(self.x);
5919 __tmp.put_f32_le(self.y);
5920 __tmp.put_f32_le(self.z);
5921 if matches!(version, MavlinkVersion::V2) {
5922 for val in &self.covariance {
5923 __tmp.put_f32_le(*val);
5924 }
5925 let len = __tmp.len();
5926 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5927 } else {
5928 __tmp.len()
5929 }
5930 }
5931}
5932#[doc = "Emit an encrypted signature / key identifying this system. PLEASE NOTE: This protocol has been kept simple, so transmitting the key requires an encrypted channel for true safety."]
5933#[doc = ""]
5934#[doc = "ID: 7"]
5935#[derive(Debug, Clone, PartialEq)]
5936#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5937#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5938#[cfg_attr(feature = "ts", derive(TS))]
5939#[cfg_attr(feature = "ts", ts(export))]
5940pub struct AUTH_KEY_DATA {
5941 #[doc = "key"]
5942 #[cfg_attr(feature = "ts", ts(type = "string"))]
5943 pub key: CharArray<32>,
5944}
5945impl AUTH_KEY_DATA {
5946 pub const ENCODED_LEN: usize = 32usize;
5947 pub const DEFAULT: Self = Self {
5948 key: CharArray::new([0_u8; 32usize]),
5949 };
5950 #[cfg(feature = "arbitrary")]
5951 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5952 use arbitrary::{Arbitrary, Unstructured};
5953 let mut buf = [0u8; 1024];
5954 rng.fill_bytes(&mut buf);
5955 let mut unstructured = Unstructured::new(&buf);
5956 Self::arbitrary(&mut unstructured).unwrap_or_default()
5957 }
5958}
5959impl Default for AUTH_KEY_DATA {
5960 fn default() -> Self {
5961 Self::DEFAULT.clone()
5962 }
5963}
5964impl MessageData for AUTH_KEY_DATA {
5965 type Message = MavMessage;
5966 const ID: u32 = 7u32;
5967 const NAME: &'static str = "AUTH_KEY";
5968 const EXTRA_CRC: u8 = 119u8;
5969 const ENCODED_LEN: usize = 32usize;
5970 fn deser(
5971 _version: MavlinkVersion,
5972 __input: &[u8],
5973 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5974 let avail_len = __input.len();
5975 let mut payload_buf = [0; Self::ENCODED_LEN];
5976 let mut buf = if avail_len < Self::ENCODED_LEN {
5977 payload_buf[0..avail_len].copy_from_slice(__input);
5978 Bytes::new(&payload_buf)
5979 } else {
5980 Bytes::new(__input)
5981 };
5982 let mut __struct = Self::default();
5983 let mut tmp = [0_u8; 32usize];
5984 for v in &mut tmp {
5985 *v = buf.get_u8();
5986 }
5987 __struct.key = CharArray::new(tmp);
5988 Ok(__struct)
5989 }
5990 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5991 let mut __tmp = BytesMut::new(bytes);
5992 #[allow(clippy::absurd_extreme_comparisons)]
5993 #[allow(unused_comparisons)]
5994 if __tmp.remaining() < Self::ENCODED_LEN {
5995 panic!(
5996 "buffer is too small (need {} bytes, but got {})",
5997 Self::ENCODED_LEN,
5998 __tmp.remaining(),
5999 )
6000 }
6001 for val in &self.key {
6002 __tmp.put_u8(*val);
6003 }
6004 if matches!(version, MavlinkVersion::V2) {
6005 let len = __tmp.len();
6006 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6007 } else {
6008 __tmp.len()
6009 }
6010 }
6011}
6012#[doc = "Low level message containing autopilot state relevant for a gimbal device. This message is to be sent from the autopilot to the gimbal device component. The data of this message are for the gimbal device's estimator corrections, in particular horizon compensation, as well as indicates autopilot control intentions, e.g. feed forward angular control in the z-axis."]
6013#[doc = ""]
6014#[doc = "ID: 286"]
6015#[derive(Debug, Clone, PartialEq)]
6016#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6017#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6018#[cfg_attr(feature = "ts", derive(TS))]
6019#[cfg_attr(feature = "ts", ts(export))]
6020pub struct AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
6021 #[doc = "Timestamp (time since system boot)."]
6022 pub time_boot_us: u64,
6023 #[doc = "Quaternion components of autopilot attitude: w, x, y, z (1 0 0 0 is the null-rotation, Hamilton convention)."]
6024 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6025 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6026 pub q: [f32; 4],
6027 #[doc = "Estimated delay of the attitude data. 0 if unknown."]
6028 pub q_estimated_delay_us: u32,
6029 #[doc = "X Speed in NED (North, East, Down). NAN if unknown."]
6030 pub vx: f32,
6031 #[doc = "Y Speed in NED (North, East, Down). NAN if unknown."]
6032 pub vy: f32,
6033 #[doc = "Z Speed in NED (North, East, Down). NAN if unknown."]
6034 pub vz: f32,
6035 #[doc = "Estimated delay of the speed data. 0 if unknown."]
6036 pub v_estimated_delay_us: u32,
6037 #[doc = "Feed forward Z component of angular velocity (positive: yawing to the right). NaN to be ignored. This is to indicate if the autopilot is actively yawing."]
6038 pub feed_forward_angular_velocity_z: f32,
6039 #[doc = "Bitmap indicating which estimator outputs are valid."]
6040 pub estimator_status: EstimatorStatusFlags,
6041 #[doc = "System ID"]
6042 pub target_system: u8,
6043 #[doc = "Component ID"]
6044 pub target_component: u8,
6045 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
6046 pub landed_state: MavLandedState,
6047 #[doc = "Z component of angular velocity in NED (North, East, Down). NaN if unknown."]
6048 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6049 pub angular_velocity_z: f32,
6050}
6051impl AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
6052 pub const ENCODED_LEN: usize = 57usize;
6053 pub const DEFAULT: Self = Self {
6054 time_boot_us: 0_u64,
6055 q: [0.0_f32; 4usize],
6056 q_estimated_delay_us: 0_u32,
6057 vx: 0.0_f32,
6058 vy: 0.0_f32,
6059 vz: 0.0_f32,
6060 v_estimated_delay_us: 0_u32,
6061 feed_forward_angular_velocity_z: 0.0_f32,
6062 estimator_status: EstimatorStatusFlags::DEFAULT,
6063 target_system: 0_u8,
6064 target_component: 0_u8,
6065 landed_state: MavLandedState::DEFAULT,
6066 angular_velocity_z: 0.0_f32,
6067 };
6068 #[cfg(feature = "arbitrary")]
6069 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6070 use arbitrary::{Arbitrary, Unstructured};
6071 let mut buf = [0u8; 1024];
6072 rng.fill_bytes(&mut buf);
6073 let mut unstructured = Unstructured::new(&buf);
6074 Self::arbitrary(&mut unstructured).unwrap_or_default()
6075 }
6076}
6077impl Default for AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
6078 fn default() -> Self {
6079 Self::DEFAULT.clone()
6080 }
6081}
6082impl MessageData for AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
6083 type Message = MavMessage;
6084 const ID: u32 = 286u32;
6085 const NAME: &'static str = "AUTOPILOT_STATE_FOR_GIMBAL_DEVICE";
6086 const EXTRA_CRC: u8 = 210u8;
6087 const ENCODED_LEN: usize = 57usize;
6088 fn deser(
6089 _version: MavlinkVersion,
6090 __input: &[u8],
6091 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6092 let avail_len = __input.len();
6093 let mut payload_buf = [0; Self::ENCODED_LEN];
6094 let mut buf = if avail_len < Self::ENCODED_LEN {
6095 payload_buf[0..avail_len].copy_from_slice(__input);
6096 Bytes::new(&payload_buf)
6097 } else {
6098 Bytes::new(__input)
6099 };
6100 let mut __struct = Self::default();
6101 __struct.time_boot_us = buf.get_u64_le();
6102 for v in &mut __struct.q {
6103 let val = buf.get_f32_le();
6104 *v = val;
6105 }
6106 __struct.q_estimated_delay_us = buf.get_u32_le();
6107 __struct.vx = buf.get_f32_le();
6108 __struct.vy = buf.get_f32_le();
6109 __struct.vz = buf.get_f32_le();
6110 __struct.v_estimated_delay_us = buf.get_u32_le();
6111 __struct.feed_forward_angular_velocity_z = buf.get_f32_le();
6112 let tmp = buf.get_u16_le();
6113 __struct.estimator_status = EstimatorStatusFlags::from_bits(tmp).ok_or(
6114 ::mavlink_core::error::ParserError::InvalidFlag {
6115 flag_type: "EstimatorStatusFlags",
6116 value: tmp as u64,
6117 },
6118 )?;
6119 __struct.target_system = buf.get_u8();
6120 __struct.target_component = buf.get_u8();
6121 let tmp = buf.get_u8();
6122 __struct.landed_state =
6123 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6124 enum_type: "MavLandedState",
6125 value: tmp as u64,
6126 })?;
6127 __struct.angular_velocity_z = buf.get_f32_le();
6128 Ok(__struct)
6129 }
6130 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6131 let mut __tmp = BytesMut::new(bytes);
6132 #[allow(clippy::absurd_extreme_comparisons)]
6133 #[allow(unused_comparisons)]
6134 if __tmp.remaining() < Self::ENCODED_LEN {
6135 panic!(
6136 "buffer is too small (need {} bytes, but got {})",
6137 Self::ENCODED_LEN,
6138 __tmp.remaining(),
6139 )
6140 }
6141 __tmp.put_u64_le(self.time_boot_us);
6142 for val in &self.q {
6143 __tmp.put_f32_le(*val);
6144 }
6145 __tmp.put_u32_le(self.q_estimated_delay_us);
6146 __tmp.put_f32_le(self.vx);
6147 __tmp.put_f32_le(self.vy);
6148 __tmp.put_f32_le(self.vz);
6149 __tmp.put_u32_le(self.v_estimated_delay_us);
6150 __tmp.put_f32_le(self.feed_forward_angular_velocity_z);
6151 __tmp.put_u16_le(self.estimator_status.bits());
6152 __tmp.put_u8(self.target_system);
6153 __tmp.put_u8(self.target_component);
6154 __tmp.put_u8(self.landed_state as u8);
6155 if matches!(version, MavlinkVersion::V2) {
6156 __tmp.put_f32_le(self.angular_velocity_z);
6157 let len = __tmp.len();
6158 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6159 } else {
6160 __tmp.len()
6161 }
6162 }
6163}
6164#[doc = "Version and capability of autopilot software. This should be emitted in response to a request with MAV_CMD_REQUEST_MESSAGE."]
6165#[doc = ""]
6166#[doc = "ID: 148"]
6167#[derive(Debug, Clone, PartialEq)]
6168#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6169#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6170#[cfg_attr(feature = "ts", derive(TS))]
6171#[cfg_attr(feature = "ts", ts(export))]
6172pub struct AUTOPILOT_VERSION_DATA {
6173 #[doc = "Bitmap of capabilities"]
6174 pub capabilities: MavProtocolCapability,
6175 #[doc = "UID if provided by hardware (see uid2)"]
6176 pub uid: u64,
6177 #[doc = "Firmware version number. The field must be encoded as 4 bytes, where each byte (shown from MSB to LSB) is part of a semantic version: (major) (minor) (patch) (FIRMWARE_VERSION_TYPE)."]
6178 pub flight_sw_version: u32,
6179 #[doc = "Middleware version number"]
6180 pub middleware_sw_version: u32,
6181 #[doc = "Operating system version number"]
6182 pub os_sw_version: u32,
6183 #[doc = "HW / board version (last 8 bits should be silicon ID, if any). The first 16 bits of this field specify <https://github.com/PX4/PX4-Bootloader/blob/master/board_types.txt>"]
6184 pub board_version: u32,
6185 #[doc = "ID of the board vendor"]
6186 pub vendor_id: u16,
6187 #[doc = "ID of the product"]
6188 pub product_id: u16,
6189 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
6190 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6191 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6192 pub flight_custom_version: [u8; 8],
6193 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
6194 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6195 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6196 pub middleware_custom_version: [u8; 8],
6197 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
6198 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6199 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6200 pub os_custom_version: [u8; 8],
6201 #[doc = "UID if provided by hardware (supersedes the uid field. If this is non-zero, use this field, otherwise use uid)"]
6202 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6203 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6204 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6205 pub uid2: [u8; 18],
6206}
6207impl AUTOPILOT_VERSION_DATA {
6208 pub const ENCODED_LEN: usize = 78usize;
6209 pub const DEFAULT: Self = Self {
6210 capabilities: MavProtocolCapability::DEFAULT,
6211 uid: 0_u64,
6212 flight_sw_version: 0_u32,
6213 middleware_sw_version: 0_u32,
6214 os_sw_version: 0_u32,
6215 board_version: 0_u32,
6216 vendor_id: 0_u16,
6217 product_id: 0_u16,
6218 flight_custom_version: [0_u8; 8usize],
6219 middleware_custom_version: [0_u8; 8usize],
6220 os_custom_version: [0_u8; 8usize],
6221 uid2: [0_u8; 18usize],
6222 };
6223 #[cfg(feature = "arbitrary")]
6224 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6225 use arbitrary::{Arbitrary, Unstructured};
6226 let mut buf = [0u8; 1024];
6227 rng.fill_bytes(&mut buf);
6228 let mut unstructured = Unstructured::new(&buf);
6229 Self::arbitrary(&mut unstructured).unwrap_or_default()
6230 }
6231}
6232impl Default for AUTOPILOT_VERSION_DATA {
6233 fn default() -> Self {
6234 Self::DEFAULT.clone()
6235 }
6236}
6237impl MessageData for AUTOPILOT_VERSION_DATA {
6238 type Message = MavMessage;
6239 const ID: u32 = 148u32;
6240 const NAME: &'static str = "AUTOPILOT_VERSION";
6241 const EXTRA_CRC: u8 = 178u8;
6242 const ENCODED_LEN: usize = 78usize;
6243 fn deser(
6244 _version: MavlinkVersion,
6245 __input: &[u8],
6246 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6247 let avail_len = __input.len();
6248 let mut payload_buf = [0; Self::ENCODED_LEN];
6249 let mut buf = if avail_len < Self::ENCODED_LEN {
6250 payload_buf[0..avail_len].copy_from_slice(__input);
6251 Bytes::new(&payload_buf)
6252 } else {
6253 Bytes::new(__input)
6254 };
6255 let mut __struct = Self::default();
6256 let tmp = buf.get_u64_le();
6257 __struct.capabilities = MavProtocolCapability::from_bits(tmp).ok_or(
6258 ::mavlink_core::error::ParserError::InvalidFlag {
6259 flag_type: "MavProtocolCapability",
6260 value: tmp as u64,
6261 },
6262 )?;
6263 __struct.uid = buf.get_u64_le();
6264 __struct.flight_sw_version = buf.get_u32_le();
6265 __struct.middleware_sw_version = buf.get_u32_le();
6266 __struct.os_sw_version = buf.get_u32_le();
6267 __struct.board_version = buf.get_u32_le();
6268 __struct.vendor_id = buf.get_u16_le();
6269 __struct.product_id = buf.get_u16_le();
6270 for v in &mut __struct.flight_custom_version {
6271 let val = buf.get_u8();
6272 *v = val;
6273 }
6274 for v in &mut __struct.middleware_custom_version {
6275 let val = buf.get_u8();
6276 *v = val;
6277 }
6278 for v in &mut __struct.os_custom_version {
6279 let val = buf.get_u8();
6280 *v = val;
6281 }
6282 for v in &mut __struct.uid2 {
6283 let val = buf.get_u8();
6284 *v = val;
6285 }
6286 Ok(__struct)
6287 }
6288 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6289 let mut __tmp = BytesMut::new(bytes);
6290 #[allow(clippy::absurd_extreme_comparisons)]
6291 #[allow(unused_comparisons)]
6292 if __tmp.remaining() < Self::ENCODED_LEN {
6293 panic!(
6294 "buffer is too small (need {} bytes, but got {})",
6295 Self::ENCODED_LEN,
6296 __tmp.remaining(),
6297 )
6298 }
6299 __tmp.put_u64_le(self.capabilities.bits());
6300 __tmp.put_u64_le(self.uid);
6301 __tmp.put_u32_le(self.flight_sw_version);
6302 __tmp.put_u32_le(self.middleware_sw_version);
6303 __tmp.put_u32_le(self.os_sw_version);
6304 __tmp.put_u32_le(self.board_version);
6305 __tmp.put_u16_le(self.vendor_id);
6306 __tmp.put_u16_le(self.product_id);
6307 for val in &self.flight_custom_version {
6308 __tmp.put_u8(*val);
6309 }
6310 for val in &self.middleware_custom_version {
6311 __tmp.put_u8(*val);
6312 }
6313 for val in &self.os_custom_version {
6314 __tmp.put_u8(*val);
6315 }
6316 if matches!(version, MavlinkVersion::V2) {
6317 for val in &self.uid2 {
6318 __tmp.put_u8(*val);
6319 }
6320 let len = __tmp.len();
6321 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6322 } else {
6323 __tmp.len()
6324 }
6325 }
6326}
6327#[doc = "Information about a flight mode. The message can be enumerated to get information for all modes, or requested for a particular mode, using MAV_CMD_REQUEST_MESSAGE. Specify 0 in param2 to request that the message is emitted for all available modes or the specific index for just one mode. The modes must be available/settable for the current vehicle/frame type. Each mode should only be emitted once (even if it is both standard and custom). Note that the current mode should be emitted in CURRENT_MODE, and that if the mode list can change then AVAILABLE_MODES_MONITOR must be emitted on first change and subsequently streamed. See <https://mavlink.io/en/services/standard_modes.html>."]
6328#[doc = ""]
6329#[doc = "ID: 435"]
6330#[derive(Debug, Clone, PartialEq)]
6331#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6332#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6333#[cfg_attr(feature = "ts", derive(TS))]
6334#[cfg_attr(feature = "ts", ts(export))]
6335pub struct AVAILABLE_MODES_DATA {
6336 #[doc = "A bitfield for use for autopilot-specific flags"]
6337 pub custom_mode: u32,
6338 #[doc = "Mode properties."]
6339 pub properties: MavModeProperty,
6340 #[doc = "The total number of available modes for the current vehicle type."]
6341 pub number_modes: u8,
6342 #[doc = "The current mode index within number_modes, indexed from 1. The index is not guaranteed to be persistent, and may change between reboots or if the set of modes change."]
6343 pub mode_index: u8,
6344 #[doc = "Standard mode."]
6345 pub standard_mode: MavStandardMode,
6346 #[doc = "Name of custom mode, with null termination character. Should be omitted for standard modes."]
6347 #[cfg_attr(feature = "ts", ts(type = "string"))]
6348 pub mode_name: CharArray<35>,
6349}
6350impl AVAILABLE_MODES_DATA {
6351 pub const ENCODED_LEN: usize = 46usize;
6352 pub const DEFAULT: Self = Self {
6353 custom_mode: 0_u32,
6354 properties: MavModeProperty::DEFAULT,
6355 number_modes: 0_u8,
6356 mode_index: 0_u8,
6357 standard_mode: MavStandardMode::DEFAULT,
6358 mode_name: CharArray::new([0_u8; 35usize]),
6359 };
6360 #[cfg(feature = "arbitrary")]
6361 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6362 use arbitrary::{Arbitrary, Unstructured};
6363 let mut buf = [0u8; 1024];
6364 rng.fill_bytes(&mut buf);
6365 let mut unstructured = Unstructured::new(&buf);
6366 Self::arbitrary(&mut unstructured).unwrap_or_default()
6367 }
6368}
6369impl Default for AVAILABLE_MODES_DATA {
6370 fn default() -> Self {
6371 Self::DEFAULT.clone()
6372 }
6373}
6374impl MessageData for AVAILABLE_MODES_DATA {
6375 type Message = MavMessage;
6376 const ID: u32 = 435u32;
6377 const NAME: &'static str = "AVAILABLE_MODES";
6378 const EXTRA_CRC: u8 = 134u8;
6379 const ENCODED_LEN: usize = 46usize;
6380 fn deser(
6381 _version: MavlinkVersion,
6382 __input: &[u8],
6383 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6384 let avail_len = __input.len();
6385 let mut payload_buf = [0; Self::ENCODED_LEN];
6386 let mut buf = if avail_len < Self::ENCODED_LEN {
6387 payload_buf[0..avail_len].copy_from_slice(__input);
6388 Bytes::new(&payload_buf)
6389 } else {
6390 Bytes::new(__input)
6391 };
6392 let mut __struct = Self::default();
6393 __struct.custom_mode = buf.get_u32_le();
6394 let tmp = buf.get_u32_le();
6395 __struct.properties = MavModeProperty::from_bits(tmp).ok_or(
6396 ::mavlink_core::error::ParserError::InvalidFlag {
6397 flag_type: "MavModeProperty",
6398 value: tmp as u64,
6399 },
6400 )?;
6401 __struct.number_modes = buf.get_u8();
6402 __struct.mode_index = buf.get_u8();
6403 let tmp = buf.get_u8();
6404 __struct.standard_mode =
6405 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6406 enum_type: "MavStandardMode",
6407 value: tmp as u64,
6408 })?;
6409 let mut tmp = [0_u8; 35usize];
6410 for v in &mut tmp {
6411 *v = buf.get_u8();
6412 }
6413 __struct.mode_name = CharArray::new(tmp);
6414 Ok(__struct)
6415 }
6416 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6417 let mut __tmp = BytesMut::new(bytes);
6418 #[allow(clippy::absurd_extreme_comparisons)]
6419 #[allow(unused_comparisons)]
6420 if __tmp.remaining() < Self::ENCODED_LEN {
6421 panic!(
6422 "buffer is too small (need {} bytes, but got {})",
6423 Self::ENCODED_LEN,
6424 __tmp.remaining(),
6425 )
6426 }
6427 __tmp.put_u32_le(self.custom_mode);
6428 __tmp.put_u32_le(self.properties.bits());
6429 __tmp.put_u8(self.number_modes);
6430 __tmp.put_u8(self.mode_index);
6431 __tmp.put_u8(self.standard_mode as u8);
6432 for val in &self.mode_name {
6433 __tmp.put_u8(*val);
6434 }
6435 if matches!(version, MavlinkVersion::V2) {
6436 let len = __tmp.len();
6437 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6438 } else {
6439 __tmp.len()
6440 }
6441 }
6442}
6443#[doc = "A change to the sequence number indicates that the set of AVAILABLE_MODES has changed. A receiver must re-request all available modes whenever the sequence number changes. This is only emitted after the first change and should then be broadcast at low rate (nominally 0.3 Hz) and on change. See <https://mavlink.io/en/services/standard_modes.html>."]
6444#[doc = ""]
6445#[doc = "ID: 437"]
6446#[derive(Debug, Clone, PartialEq)]
6447#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6448#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6449#[cfg_attr(feature = "ts", derive(TS))]
6450#[cfg_attr(feature = "ts", ts(export))]
6451pub struct AVAILABLE_MODES_MONITOR_DATA {
6452 #[doc = "Sequence number. The value iterates sequentially whenever AVAILABLE_MODES changes (e.g. support for a new mode is added/removed dynamically)."]
6453 pub seq: u8,
6454}
6455impl AVAILABLE_MODES_MONITOR_DATA {
6456 pub const ENCODED_LEN: usize = 1usize;
6457 pub const DEFAULT: Self = Self { seq: 0_u8 };
6458 #[cfg(feature = "arbitrary")]
6459 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6460 use arbitrary::{Arbitrary, Unstructured};
6461 let mut buf = [0u8; 1024];
6462 rng.fill_bytes(&mut buf);
6463 let mut unstructured = Unstructured::new(&buf);
6464 Self::arbitrary(&mut unstructured).unwrap_or_default()
6465 }
6466}
6467impl Default for AVAILABLE_MODES_MONITOR_DATA {
6468 fn default() -> Self {
6469 Self::DEFAULT.clone()
6470 }
6471}
6472impl MessageData for AVAILABLE_MODES_MONITOR_DATA {
6473 type Message = MavMessage;
6474 const ID: u32 = 437u32;
6475 const NAME: &'static str = "AVAILABLE_MODES_MONITOR";
6476 const EXTRA_CRC: u8 = 30u8;
6477 const ENCODED_LEN: usize = 1usize;
6478 fn deser(
6479 _version: MavlinkVersion,
6480 __input: &[u8],
6481 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6482 let avail_len = __input.len();
6483 let mut payload_buf = [0; Self::ENCODED_LEN];
6484 let mut buf = if avail_len < Self::ENCODED_LEN {
6485 payload_buf[0..avail_len].copy_from_slice(__input);
6486 Bytes::new(&payload_buf)
6487 } else {
6488 Bytes::new(__input)
6489 };
6490 let mut __struct = Self::default();
6491 __struct.seq = buf.get_u8();
6492 Ok(__struct)
6493 }
6494 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6495 let mut __tmp = BytesMut::new(bytes);
6496 #[allow(clippy::absurd_extreme_comparisons)]
6497 #[allow(unused_comparisons)]
6498 if __tmp.remaining() < Self::ENCODED_LEN {
6499 panic!(
6500 "buffer is too small (need {} bytes, but got {})",
6501 Self::ENCODED_LEN,
6502 __tmp.remaining(),
6503 )
6504 }
6505 __tmp.put_u8(self.seq);
6506 if matches!(version, MavlinkVersion::V2) {
6507 let len = __tmp.len();
6508 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6509 } else {
6510 __tmp.len()
6511 }
6512 }
6513}
6514#[doc = "Battery information that is static, or requires infrequent update. This message should requested using MAV_CMD_REQUEST_MESSAGE and/or streamed at very low rate. BATTERY_STATUS_V2 is used for higher-rate battery status information."]
6515#[doc = ""]
6516#[doc = "ID: 372"]
6517#[derive(Debug, Clone, PartialEq)]
6518#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6519#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6520#[cfg_attr(feature = "ts", derive(TS))]
6521#[cfg_attr(feature = "ts", ts(export))]
6522pub struct BATTERY_INFO_DATA {
6523 #[doc = "Minimum per-cell voltage when discharging. 0: field not provided."]
6524 pub discharge_minimum_voltage: f32,
6525 #[doc = "Minimum per-cell voltage when charging. 0: field not provided."]
6526 pub charging_minimum_voltage: f32,
6527 #[doc = "Minimum per-cell voltage when resting. 0: field not provided."]
6528 pub resting_minimum_voltage: f32,
6529 #[doc = "Maximum per-cell voltage when charged. 0: field not provided."]
6530 pub charging_maximum_voltage: f32,
6531 #[doc = "Maximum pack continuous charge current. 0: field not provided."]
6532 pub charging_maximum_current: f32,
6533 #[doc = "Battery nominal voltage. Used for conversion between Wh and Ah. 0: field not provided."]
6534 pub nominal_voltage: f32,
6535 #[doc = "Maximum pack discharge current. 0: field not provided."]
6536 pub discharge_maximum_current: f32,
6537 #[doc = "Maximum pack discharge burst current. 0: field not provided."]
6538 pub discharge_maximum_burst_current: f32,
6539 #[doc = "Fully charged design capacity. 0: field not provided."]
6540 pub design_capacity: f32,
6541 #[doc = "Predicted battery capacity when fully charged (accounting for battery degradation). NAN: field not provided."]
6542 pub full_charge_capacity: f32,
6543 #[doc = "Lifetime count of the number of charge/discharge cycles (<https://en.wikipedia.org/wiki/Charge_cycle>). UINT16_MAX: field not provided."]
6544 pub cycle_count: u16,
6545 #[doc = "Battery weight. 0: field not provided."]
6546 pub weight: u16,
6547 #[doc = "Battery ID"]
6548 pub id: u8,
6549 #[doc = "Function of the battery."]
6550 pub battery_function: MavBatteryFunction,
6551 #[doc = "Type (chemistry) of the battery."]
6552 pub mavtype: MavBatteryType,
6553 #[doc = "State of Health (SOH) estimate. Typically 100% at the time of manufacture and will decrease over time and use. -1: field not provided."]
6554 pub state_of_health: u8,
6555 #[doc = "Number of battery cells in series. 0: field not provided."]
6556 pub cells_in_series: u8,
6557 #[doc = "Manufacture date (DDMMYYYY) in ASCII characters, 0 terminated. All 0: field not provided."]
6558 #[cfg_attr(feature = "ts", ts(type = "string"))]
6559 pub manufacture_date: CharArray<9>,
6560 #[doc = "Serial number in ASCII characters, 0 terminated. All 0: field not provided."]
6561 #[cfg_attr(feature = "ts", ts(type = "string"))]
6562 pub serial_number: CharArray<32>,
6563 #[doc = "Battery device name. Formatted as manufacturer name then product name, separated with an underscore (in ASCII characters), 0 terminated. All 0: field not provided."]
6564 #[cfg_attr(feature = "ts", ts(type = "string"))]
6565 pub name: CharArray<50>,
6566}
6567impl BATTERY_INFO_DATA {
6568 pub const ENCODED_LEN: usize = 140usize;
6569 pub const DEFAULT: Self = Self {
6570 discharge_minimum_voltage: 0.0_f32,
6571 charging_minimum_voltage: 0.0_f32,
6572 resting_minimum_voltage: 0.0_f32,
6573 charging_maximum_voltage: 0.0_f32,
6574 charging_maximum_current: 0.0_f32,
6575 nominal_voltage: 0.0_f32,
6576 discharge_maximum_current: 0.0_f32,
6577 discharge_maximum_burst_current: 0.0_f32,
6578 design_capacity: 0.0_f32,
6579 full_charge_capacity: 0.0_f32,
6580 cycle_count: 0_u16,
6581 weight: 0_u16,
6582 id: 0_u8,
6583 battery_function: MavBatteryFunction::DEFAULT,
6584 mavtype: MavBatteryType::DEFAULT,
6585 state_of_health: 0_u8,
6586 cells_in_series: 0_u8,
6587 manufacture_date: CharArray::new([0_u8; 9usize]),
6588 serial_number: CharArray::new([0_u8; 32usize]),
6589 name: CharArray::new([0_u8; 50usize]),
6590 };
6591 #[cfg(feature = "arbitrary")]
6592 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6593 use arbitrary::{Arbitrary, Unstructured};
6594 let mut buf = [0u8; 1024];
6595 rng.fill_bytes(&mut buf);
6596 let mut unstructured = Unstructured::new(&buf);
6597 Self::arbitrary(&mut unstructured).unwrap_or_default()
6598 }
6599}
6600impl Default for BATTERY_INFO_DATA {
6601 fn default() -> Self {
6602 Self::DEFAULT.clone()
6603 }
6604}
6605impl MessageData for BATTERY_INFO_DATA {
6606 type Message = MavMessage;
6607 const ID: u32 = 372u32;
6608 const NAME: &'static str = "BATTERY_INFO";
6609 const EXTRA_CRC: u8 = 26u8;
6610 const ENCODED_LEN: usize = 140usize;
6611 fn deser(
6612 _version: MavlinkVersion,
6613 __input: &[u8],
6614 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6615 let avail_len = __input.len();
6616 let mut payload_buf = [0; Self::ENCODED_LEN];
6617 let mut buf = if avail_len < Self::ENCODED_LEN {
6618 payload_buf[0..avail_len].copy_from_slice(__input);
6619 Bytes::new(&payload_buf)
6620 } else {
6621 Bytes::new(__input)
6622 };
6623 let mut __struct = Self::default();
6624 __struct.discharge_minimum_voltage = buf.get_f32_le();
6625 __struct.charging_minimum_voltage = buf.get_f32_le();
6626 __struct.resting_minimum_voltage = buf.get_f32_le();
6627 __struct.charging_maximum_voltage = buf.get_f32_le();
6628 __struct.charging_maximum_current = buf.get_f32_le();
6629 __struct.nominal_voltage = buf.get_f32_le();
6630 __struct.discharge_maximum_current = buf.get_f32_le();
6631 __struct.discharge_maximum_burst_current = buf.get_f32_le();
6632 __struct.design_capacity = buf.get_f32_le();
6633 __struct.full_charge_capacity = buf.get_f32_le();
6634 __struct.cycle_count = buf.get_u16_le();
6635 __struct.weight = buf.get_u16_le();
6636 __struct.id = buf.get_u8();
6637 let tmp = buf.get_u8();
6638 __struct.battery_function =
6639 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6640 enum_type: "MavBatteryFunction",
6641 value: tmp as u64,
6642 })?;
6643 let tmp = buf.get_u8();
6644 __struct.mavtype =
6645 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6646 enum_type: "MavBatteryType",
6647 value: tmp as u64,
6648 })?;
6649 __struct.state_of_health = buf.get_u8();
6650 __struct.cells_in_series = buf.get_u8();
6651 let mut tmp = [0_u8; 9usize];
6652 for v in &mut tmp {
6653 *v = buf.get_u8();
6654 }
6655 __struct.manufacture_date = CharArray::new(tmp);
6656 let mut tmp = [0_u8; 32usize];
6657 for v in &mut tmp {
6658 *v = buf.get_u8();
6659 }
6660 __struct.serial_number = CharArray::new(tmp);
6661 let mut tmp = [0_u8; 50usize];
6662 for v in &mut tmp {
6663 *v = buf.get_u8();
6664 }
6665 __struct.name = CharArray::new(tmp);
6666 Ok(__struct)
6667 }
6668 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6669 let mut __tmp = BytesMut::new(bytes);
6670 #[allow(clippy::absurd_extreme_comparisons)]
6671 #[allow(unused_comparisons)]
6672 if __tmp.remaining() < Self::ENCODED_LEN {
6673 panic!(
6674 "buffer is too small (need {} bytes, but got {})",
6675 Self::ENCODED_LEN,
6676 __tmp.remaining(),
6677 )
6678 }
6679 __tmp.put_f32_le(self.discharge_minimum_voltage);
6680 __tmp.put_f32_le(self.charging_minimum_voltage);
6681 __tmp.put_f32_le(self.resting_minimum_voltage);
6682 __tmp.put_f32_le(self.charging_maximum_voltage);
6683 __tmp.put_f32_le(self.charging_maximum_current);
6684 __tmp.put_f32_le(self.nominal_voltage);
6685 __tmp.put_f32_le(self.discharge_maximum_current);
6686 __tmp.put_f32_le(self.discharge_maximum_burst_current);
6687 __tmp.put_f32_le(self.design_capacity);
6688 __tmp.put_f32_le(self.full_charge_capacity);
6689 __tmp.put_u16_le(self.cycle_count);
6690 __tmp.put_u16_le(self.weight);
6691 __tmp.put_u8(self.id);
6692 __tmp.put_u8(self.battery_function as u8);
6693 __tmp.put_u8(self.mavtype as u8);
6694 __tmp.put_u8(self.state_of_health);
6695 __tmp.put_u8(self.cells_in_series);
6696 for val in &self.manufacture_date {
6697 __tmp.put_u8(*val);
6698 }
6699 for val in &self.serial_number {
6700 __tmp.put_u8(*val);
6701 }
6702 for val in &self.name {
6703 __tmp.put_u8(*val);
6704 }
6705 if matches!(version, MavlinkVersion::V2) {
6706 let len = __tmp.len();
6707 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6708 } else {
6709 __tmp.len()
6710 }
6711 }
6712}
6713#[doc = "Battery information. Updates GCS with flight controller battery status. Smart batteries also use this message, but may additionally send BATTERY_INFO."]
6714#[doc = ""]
6715#[doc = "ID: 147"]
6716#[derive(Debug, Clone, PartialEq)]
6717#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6718#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6719#[cfg_attr(feature = "ts", derive(TS))]
6720#[cfg_attr(feature = "ts", ts(export))]
6721pub struct BATTERY_STATUS_DATA {
6722 #[doc = "Consumed charge, -1: autopilot does not provide consumption estimate"]
6723 pub current_consumed: i32,
6724 #[doc = "Consumed energy, -1: autopilot does not provide energy consumption estimate"]
6725 pub energy_consumed: i32,
6726 #[doc = "Temperature of the battery. INT16_MAX for unknown temperature."]
6727 pub temperature: i16,
6728 #[doc = "Battery voltage of cells 1 to 10 (see voltages_ext for cells 11-14). Cells in this field above the valid cell count for this battery should have the UINT16_MAX value. If individual cell voltages are unknown or not measured for this battery, then the overall battery voltage should be filled in cell 0, with all others set to UINT16_MAX. If the voltage of the battery is greater than (UINT16_MAX - 1), then cell 0 should be set to (UINT16_MAX - 1), and cell 1 to the remaining voltage. This can be extended to multiple cells if the total voltage is greater than 2 * (UINT16_MAX - 1)."]
6729 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6730 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6731 pub voltages: [u16; 10],
6732 #[doc = "Battery current, -1: autopilot does not measure the current"]
6733 pub current_battery: i16,
6734 #[doc = "Battery ID"]
6735 pub id: u8,
6736 #[doc = "Function of the battery"]
6737 pub battery_function: MavBatteryFunction,
6738 #[doc = "Type (chemistry) of the battery"]
6739 pub mavtype: MavBatteryType,
6740 #[doc = "Remaining battery energy. Values: [0-100], -1: autopilot does not estimate the remaining battery."]
6741 pub battery_remaining: i8,
6742 #[doc = "Remaining battery time, 0: autopilot does not provide remaining battery time estimate"]
6743 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6744 pub time_remaining: i32,
6745 #[doc = "State for extent of discharge, provided by autopilot for warning or external reactions"]
6746 #[cfg_attr(feature = "serde", serde(default))]
6747 pub charge_state: MavBatteryChargeState,
6748 #[doc = "Battery voltages for cells 11 to 14. Cells above the valid cell count for this battery should have a value of 0, where zero indicates not supported (note, this is different than for the voltages field and allows empty byte truncation). If the measured value is 0 then 1 should be sent instead."]
6749 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6750 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6751 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6752 pub voltages_ext: [u16; 4],
6753 #[doc = "Battery mode. Default (0) is that battery mode reporting is not supported or battery is in normal-use mode."]
6754 #[cfg_attr(feature = "serde", serde(default))]
6755 pub mode: MavBatteryMode,
6756 #[doc = "Fault/health indications. These should be set when charge_state is MAV_BATTERY_CHARGE_STATE_FAILED or MAV_BATTERY_CHARGE_STATE_UNHEALTHY (if not, fault reporting is not supported)."]
6757 #[cfg_attr(feature = "serde", serde(default))]
6758 pub fault_bitmask: MavBatteryFault,
6759}
6760impl BATTERY_STATUS_DATA {
6761 pub const ENCODED_LEN: usize = 54usize;
6762 pub const DEFAULT: Self = Self {
6763 current_consumed: 0_i32,
6764 energy_consumed: 0_i32,
6765 temperature: 0_i16,
6766 voltages: [0_u16; 10usize],
6767 current_battery: 0_i16,
6768 id: 0_u8,
6769 battery_function: MavBatteryFunction::DEFAULT,
6770 mavtype: MavBatteryType::DEFAULT,
6771 battery_remaining: 0_i8,
6772 time_remaining: 0_i32,
6773 charge_state: MavBatteryChargeState::DEFAULT,
6774 voltages_ext: [0_u16; 4usize],
6775 mode: MavBatteryMode::DEFAULT,
6776 fault_bitmask: MavBatteryFault::DEFAULT,
6777 };
6778 #[cfg(feature = "arbitrary")]
6779 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6780 use arbitrary::{Arbitrary, Unstructured};
6781 let mut buf = [0u8; 1024];
6782 rng.fill_bytes(&mut buf);
6783 let mut unstructured = Unstructured::new(&buf);
6784 Self::arbitrary(&mut unstructured).unwrap_or_default()
6785 }
6786}
6787impl Default for BATTERY_STATUS_DATA {
6788 fn default() -> Self {
6789 Self::DEFAULT.clone()
6790 }
6791}
6792impl MessageData for BATTERY_STATUS_DATA {
6793 type Message = MavMessage;
6794 const ID: u32 = 147u32;
6795 const NAME: &'static str = "BATTERY_STATUS";
6796 const EXTRA_CRC: u8 = 154u8;
6797 const ENCODED_LEN: usize = 54usize;
6798 fn deser(
6799 _version: MavlinkVersion,
6800 __input: &[u8],
6801 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6802 let avail_len = __input.len();
6803 let mut payload_buf = [0; Self::ENCODED_LEN];
6804 let mut buf = if avail_len < Self::ENCODED_LEN {
6805 payload_buf[0..avail_len].copy_from_slice(__input);
6806 Bytes::new(&payload_buf)
6807 } else {
6808 Bytes::new(__input)
6809 };
6810 let mut __struct = Self::default();
6811 __struct.current_consumed = buf.get_i32_le();
6812 __struct.energy_consumed = buf.get_i32_le();
6813 __struct.temperature = buf.get_i16_le();
6814 for v in &mut __struct.voltages {
6815 let val = buf.get_u16_le();
6816 *v = val;
6817 }
6818 __struct.current_battery = buf.get_i16_le();
6819 __struct.id = buf.get_u8();
6820 let tmp = buf.get_u8();
6821 __struct.battery_function =
6822 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6823 enum_type: "MavBatteryFunction",
6824 value: tmp as u64,
6825 })?;
6826 let tmp = buf.get_u8();
6827 __struct.mavtype =
6828 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6829 enum_type: "MavBatteryType",
6830 value: tmp as u64,
6831 })?;
6832 __struct.battery_remaining = buf.get_i8();
6833 __struct.time_remaining = buf.get_i32_le();
6834 let tmp = buf.get_u8();
6835 __struct.charge_state =
6836 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6837 enum_type: "MavBatteryChargeState",
6838 value: tmp as u64,
6839 })?;
6840 for v in &mut __struct.voltages_ext {
6841 let val = buf.get_u16_le();
6842 *v = val;
6843 }
6844 let tmp = buf.get_u8();
6845 __struct.mode =
6846 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6847 enum_type: "MavBatteryMode",
6848 value: tmp as u64,
6849 })?;
6850 let tmp = buf.get_u32_le();
6851 __struct.fault_bitmask = MavBatteryFault::from_bits(tmp).ok_or(
6852 ::mavlink_core::error::ParserError::InvalidFlag {
6853 flag_type: "MavBatteryFault",
6854 value: tmp as u64,
6855 },
6856 )?;
6857 Ok(__struct)
6858 }
6859 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6860 let mut __tmp = BytesMut::new(bytes);
6861 #[allow(clippy::absurd_extreme_comparisons)]
6862 #[allow(unused_comparisons)]
6863 if __tmp.remaining() < Self::ENCODED_LEN {
6864 panic!(
6865 "buffer is too small (need {} bytes, but got {})",
6866 Self::ENCODED_LEN,
6867 __tmp.remaining(),
6868 )
6869 }
6870 __tmp.put_i32_le(self.current_consumed);
6871 __tmp.put_i32_le(self.energy_consumed);
6872 __tmp.put_i16_le(self.temperature);
6873 for val in &self.voltages {
6874 __tmp.put_u16_le(*val);
6875 }
6876 __tmp.put_i16_le(self.current_battery);
6877 __tmp.put_u8(self.id);
6878 __tmp.put_u8(self.battery_function as u8);
6879 __tmp.put_u8(self.mavtype as u8);
6880 __tmp.put_i8(self.battery_remaining);
6881 if matches!(version, MavlinkVersion::V2) {
6882 __tmp.put_i32_le(self.time_remaining);
6883 __tmp.put_u8(self.charge_state as u8);
6884 for val in &self.voltages_ext {
6885 __tmp.put_u16_le(*val);
6886 }
6887 __tmp.put_u8(self.mode as u8);
6888 __tmp.put_u32_le(self.fault_bitmask.bits());
6889 let len = __tmp.len();
6890 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6891 } else {
6892 __tmp.len()
6893 }
6894 }
6895}
6896#[doc = "Report button state change."]
6897#[doc = ""]
6898#[doc = "ID: 257"]
6899#[derive(Debug, Clone, PartialEq)]
6900#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6901#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6902#[cfg_attr(feature = "ts", derive(TS))]
6903#[cfg_attr(feature = "ts", ts(export))]
6904pub struct BUTTON_CHANGE_DATA {
6905 #[doc = "Timestamp (time since system boot)."]
6906 pub time_boot_ms: u32,
6907 #[doc = "Time of last change of button state."]
6908 pub last_change_ms: u32,
6909 #[doc = "Bitmap for state of buttons."]
6910 pub state: u8,
6911}
6912impl BUTTON_CHANGE_DATA {
6913 pub const ENCODED_LEN: usize = 9usize;
6914 pub const DEFAULT: Self = Self {
6915 time_boot_ms: 0_u32,
6916 last_change_ms: 0_u32,
6917 state: 0_u8,
6918 };
6919 #[cfg(feature = "arbitrary")]
6920 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6921 use arbitrary::{Arbitrary, Unstructured};
6922 let mut buf = [0u8; 1024];
6923 rng.fill_bytes(&mut buf);
6924 let mut unstructured = Unstructured::new(&buf);
6925 Self::arbitrary(&mut unstructured).unwrap_or_default()
6926 }
6927}
6928impl Default for BUTTON_CHANGE_DATA {
6929 fn default() -> Self {
6930 Self::DEFAULT.clone()
6931 }
6932}
6933impl MessageData for BUTTON_CHANGE_DATA {
6934 type Message = MavMessage;
6935 const ID: u32 = 257u32;
6936 const NAME: &'static str = "BUTTON_CHANGE";
6937 const EXTRA_CRC: u8 = 131u8;
6938 const ENCODED_LEN: usize = 9usize;
6939 fn deser(
6940 _version: MavlinkVersion,
6941 __input: &[u8],
6942 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6943 let avail_len = __input.len();
6944 let mut payload_buf = [0; Self::ENCODED_LEN];
6945 let mut buf = if avail_len < Self::ENCODED_LEN {
6946 payload_buf[0..avail_len].copy_from_slice(__input);
6947 Bytes::new(&payload_buf)
6948 } else {
6949 Bytes::new(__input)
6950 };
6951 let mut __struct = Self::default();
6952 __struct.time_boot_ms = buf.get_u32_le();
6953 __struct.last_change_ms = buf.get_u32_le();
6954 __struct.state = buf.get_u8();
6955 Ok(__struct)
6956 }
6957 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6958 let mut __tmp = BytesMut::new(bytes);
6959 #[allow(clippy::absurd_extreme_comparisons)]
6960 #[allow(unused_comparisons)]
6961 if __tmp.remaining() < Self::ENCODED_LEN {
6962 panic!(
6963 "buffer is too small (need {} bytes, but got {})",
6964 Self::ENCODED_LEN,
6965 __tmp.remaining(),
6966 )
6967 }
6968 __tmp.put_u32_le(self.time_boot_ms);
6969 __tmp.put_u32_le(self.last_change_ms);
6970 __tmp.put_u8(self.state);
6971 if matches!(version, MavlinkVersion::V2) {
6972 let len = __tmp.len();
6973 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6974 } else {
6975 __tmp.len()
6976 }
6977 }
6978}
6979#[doc = "Information about the status of a capture. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
6980#[doc = ""]
6981#[doc = "ID: 262"]
6982#[derive(Debug, Clone, PartialEq)]
6983#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6984#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6985#[cfg_attr(feature = "ts", derive(TS))]
6986#[cfg_attr(feature = "ts", ts(export))]
6987pub struct CAMERA_CAPTURE_STATUS_DATA {
6988 #[doc = "Timestamp (time since system boot)."]
6989 pub time_boot_ms: u32,
6990 #[doc = "Image capture interval"]
6991 pub image_interval: f32,
6992 #[doc = "Elapsed time since recording started (0: Not supported/available). A GCS should compute recording time and use non-zero values of this field to correct any discrepancy."]
6993 pub recording_time_ms: u32,
6994 #[doc = "Available storage capacity."]
6995 pub available_capacity: f32,
6996 #[doc = "Current status of image capturing (0: idle, 1: capture in progress, 2: interval set but idle, 3: interval set and capture in progress)"]
6997 pub image_status: u8,
6998 #[doc = "Current status of video capturing (0: idle, 1: capture in progress)"]
6999 pub video_status: u8,
7000 #[doc = "Total number of images captured ('forever', or until reset using MAV_CMD_STORAGE_FORMAT)."]
7001 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7002 pub image_count: i32,
7003 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7004 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7005 pub camera_device_id: u8,
7006}
7007impl CAMERA_CAPTURE_STATUS_DATA {
7008 pub const ENCODED_LEN: usize = 23usize;
7009 pub const DEFAULT: Self = Self {
7010 time_boot_ms: 0_u32,
7011 image_interval: 0.0_f32,
7012 recording_time_ms: 0_u32,
7013 available_capacity: 0.0_f32,
7014 image_status: 0_u8,
7015 video_status: 0_u8,
7016 image_count: 0_i32,
7017 camera_device_id: 0_u8,
7018 };
7019 #[cfg(feature = "arbitrary")]
7020 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7021 use arbitrary::{Arbitrary, Unstructured};
7022 let mut buf = [0u8; 1024];
7023 rng.fill_bytes(&mut buf);
7024 let mut unstructured = Unstructured::new(&buf);
7025 Self::arbitrary(&mut unstructured).unwrap_or_default()
7026 }
7027}
7028impl Default for CAMERA_CAPTURE_STATUS_DATA {
7029 fn default() -> Self {
7030 Self::DEFAULT.clone()
7031 }
7032}
7033impl MessageData for CAMERA_CAPTURE_STATUS_DATA {
7034 type Message = MavMessage;
7035 const ID: u32 = 262u32;
7036 const NAME: &'static str = "CAMERA_CAPTURE_STATUS";
7037 const EXTRA_CRC: u8 = 12u8;
7038 const ENCODED_LEN: usize = 23usize;
7039 fn deser(
7040 _version: MavlinkVersion,
7041 __input: &[u8],
7042 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7043 let avail_len = __input.len();
7044 let mut payload_buf = [0; Self::ENCODED_LEN];
7045 let mut buf = if avail_len < Self::ENCODED_LEN {
7046 payload_buf[0..avail_len].copy_from_slice(__input);
7047 Bytes::new(&payload_buf)
7048 } else {
7049 Bytes::new(__input)
7050 };
7051 let mut __struct = Self::default();
7052 __struct.time_boot_ms = buf.get_u32_le();
7053 __struct.image_interval = buf.get_f32_le();
7054 __struct.recording_time_ms = buf.get_u32_le();
7055 __struct.available_capacity = buf.get_f32_le();
7056 __struct.image_status = buf.get_u8();
7057 __struct.video_status = buf.get_u8();
7058 __struct.image_count = buf.get_i32_le();
7059 __struct.camera_device_id = buf.get_u8();
7060 Ok(__struct)
7061 }
7062 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7063 let mut __tmp = BytesMut::new(bytes);
7064 #[allow(clippy::absurd_extreme_comparisons)]
7065 #[allow(unused_comparisons)]
7066 if __tmp.remaining() < Self::ENCODED_LEN {
7067 panic!(
7068 "buffer is too small (need {} bytes, but got {})",
7069 Self::ENCODED_LEN,
7070 __tmp.remaining(),
7071 )
7072 }
7073 __tmp.put_u32_le(self.time_boot_ms);
7074 __tmp.put_f32_le(self.image_interval);
7075 __tmp.put_u32_le(self.recording_time_ms);
7076 __tmp.put_f32_le(self.available_capacity);
7077 __tmp.put_u8(self.image_status);
7078 __tmp.put_u8(self.video_status);
7079 if matches!(version, MavlinkVersion::V2) {
7080 __tmp.put_i32_le(self.image_count);
7081 __tmp.put_u8(self.camera_device_id);
7082 let len = __tmp.len();
7083 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7084 } else {
7085 __tmp.len()
7086 }
7087 }
7088}
7089#[doc = "Information about the field of view of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
7090#[doc = ""]
7091#[doc = "ID: 271"]
7092#[derive(Debug, Clone, PartialEq)]
7093#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7094#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7095#[cfg_attr(feature = "ts", derive(TS))]
7096#[cfg_attr(feature = "ts", ts(export))]
7097pub struct CAMERA_FOV_STATUS_DATA {
7098 #[doc = "Timestamp (time since system boot)."]
7099 pub time_boot_ms: u32,
7100 #[doc = "Latitude of camera (INT32_MAX if unknown)."]
7101 pub lat_camera: i32,
7102 #[doc = "Longitude of camera (INT32_MAX if unknown)."]
7103 pub lon_camera: i32,
7104 #[doc = "Altitude (MSL) of camera (INT32_MAX if unknown)."]
7105 pub alt_camera: i32,
7106 #[doc = "Latitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
7107 pub lat_image: i32,
7108 #[doc = "Longitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
7109 pub lon_image: i32,
7110 #[doc = "Altitude (MSL) of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
7111 pub alt_image: i32,
7112 #[doc = "Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
7113 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7114 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7115 pub q: [f32; 4],
7116 #[doc = "Horizontal field of view (NaN if unknown)."]
7117 pub hfov: f32,
7118 #[doc = "Vertical field of view (NaN if unknown)."]
7119 pub vfov: f32,
7120 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7121 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7122 pub camera_device_id: u8,
7123}
7124impl CAMERA_FOV_STATUS_DATA {
7125 pub const ENCODED_LEN: usize = 53usize;
7126 pub const DEFAULT: Self = Self {
7127 time_boot_ms: 0_u32,
7128 lat_camera: 0_i32,
7129 lon_camera: 0_i32,
7130 alt_camera: 0_i32,
7131 lat_image: 0_i32,
7132 lon_image: 0_i32,
7133 alt_image: 0_i32,
7134 q: [0.0_f32; 4usize],
7135 hfov: 0.0_f32,
7136 vfov: 0.0_f32,
7137 camera_device_id: 0_u8,
7138 };
7139 #[cfg(feature = "arbitrary")]
7140 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7141 use arbitrary::{Arbitrary, Unstructured};
7142 let mut buf = [0u8; 1024];
7143 rng.fill_bytes(&mut buf);
7144 let mut unstructured = Unstructured::new(&buf);
7145 Self::arbitrary(&mut unstructured).unwrap_or_default()
7146 }
7147}
7148impl Default for CAMERA_FOV_STATUS_DATA {
7149 fn default() -> Self {
7150 Self::DEFAULT.clone()
7151 }
7152}
7153impl MessageData for CAMERA_FOV_STATUS_DATA {
7154 type Message = MavMessage;
7155 const ID: u32 = 271u32;
7156 const NAME: &'static str = "CAMERA_FOV_STATUS";
7157 const EXTRA_CRC: u8 = 22u8;
7158 const ENCODED_LEN: usize = 53usize;
7159 fn deser(
7160 _version: MavlinkVersion,
7161 __input: &[u8],
7162 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7163 let avail_len = __input.len();
7164 let mut payload_buf = [0; Self::ENCODED_LEN];
7165 let mut buf = if avail_len < Self::ENCODED_LEN {
7166 payload_buf[0..avail_len].copy_from_slice(__input);
7167 Bytes::new(&payload_buf)
7168 } else {
7169 Bytes::new(__input)
7170 };
7171 let mut __struct = Self::default();
7172 __struct.time_boot_ms = buf.get_u32_le();
7173 __struct.lat_camera = buf.get_i32_le();
7174 __struct.lon_camera = buf.get_i32_le();
7175 __struct.alt_camera = buf.get_i32_le();
7176 __struct.lat_image = buf.get_i32_le();
7177 __struct.lon_image = buf.get_i32_le();
7178 __struct.alt_image = buf.get_i32_le();
7179 for v in &mut __struct.q {
7180 let val = buf.get_f32_le();
7181 *v = val;
7182 }
7183 __struct.hfov = buf.get_f32_le();
7184 __struct.vfov = buf.get_f32_le();
7185 __struct.camera_device_id = buf.get_u8();
7186 Ok(__struct)
7187 }
7188 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7189 let mut __tmp = BytesMut::new(bytes);
7190 #[allow(clippy::absurd_extreme_comparisons)]
7191 #[allow(unused_comparisons)]
7192 if __tmp.remaining() < Self::ENCODED_LEN {
7193 panic!(
7194 "buffer is too small (need {} bytes, but got {})",
7195 Self::ENCODED_LEN,
7196 __tmp.remaining(),
7197 )
7198 }
7199 __tmp.put_u32_le(self.time_boot_ms);
7200 __tmp.put_i32_le(self.lat_camera);
7201 __tmp.put_i32_le(self.lon_camera);
7202 __tmp.put_i32_le(self.alt_camera);
7203 __tmp.put_i32_le(self.lat_image);
7204 __tmp.put_i32_le(self.lon_image);
7205 __tmp.put_i32_le(self.alt_image);
7206 for val in &self.q {
7207 __tmp.put_f32_le(*val);
7208 }
7209 __tmp.put_f32_le(self.hfov);
7210 __tmp.put_f32_le(self.vfov);
7211 if matches!(version, MavlinkVersion::V2) {
7212 __tmp.put_u8(self.camera_device_id);
7213 let len = __tmp.len();
7214 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7215 } else {
7216 __tmp.len()
7217 }
7218 }
7219}
7220#[doc = "Information about a captured image. This is emitted every time a message is captured. MAV_CMD_REQUEST_MESSAGE can be used to (re)request this message for a specific sequence number or range of sequence numbers: MAV_CMD_REQUEST_MESSAGE.param2 indicates the sequence number the first image to send, or set to -1 to send the message for all sequence numbers. MAV_CMD_REQUEST_MESSAGE.param3 is used to specify a range of messages to send: set to 0 (default) to send just the the message for the sequence number in param 2, set to -1 to send the message for the sequence number in param 2 and all the following sequence numbers, set to the sequence number of the final message in the range."]
7221#[doc = ""]
7222#[doc = "ID: 263"]
7223#[derive(Debug, Clone, PartialEq)]
7224#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7225#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7226#[cfg_attr(feature = "ts", derive(TS))]
7227#[cfg_attr(feature = "ts", ts(export))]
7228pub struct CAMERA_IMAGE_CAPTURED_DATA {
7229 #[doc = "Timestamp (time since UNIX epoch) in UTC. 0 for unknown."]
7230 pub time_utc: u64,
7231 #[doc = "Timestamp (time since system boot)."]
7232 pub time_boot_ms: u32,
7233 #[doc = "Latitude where image was taken"]
7234 pub lat: i32,
7235 #[doc = "Longitude where capture was taken"]
7236 pub lon: i32,
7237 #[doc = "Altitude (MSL) where image was taken"]
7238 pub alt: i32,
7239 #[doc = "Altitude above ground"]
7240 pub relative_alt: i32,
7241 #[doc = "Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
7242 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7243 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7244 pub q: [f32; 4],
7245 #[doc = "Zero based index of this image (i.e. a new image will have index CAMERA_CAPTURE_STATUS.image count -1)"]
7246 pub image_index: i32,
7247 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id). Field name is usually camera_device_id."]
7248 pub camera_id: u8,
7249 #[doc = "Boolean indicating success (1) or failure (0) while capturing this image."]
7250 pub capture_result: i8,
7251 #[doc = "URL of image taken. Either local storage or <http://foo.jpg> if camera provides an HTTP interface."]
7252 #[cfg_attr(feature = "ts", ts(type = "string"))]
7253 pub file_url: CharArray<205>,
7254}
7255impl CAMERA_IMAGE_CAPTURED_DATA {
7256 pub const ENCODED_LEN: usize = 255usize;
7257 pub const DEFAULT: Self = Self {
7258 time_utc: 0_u64,
7259 time_boot_ms: 0_u32,
7260 lat: 0_i32,
7261 lon: 0_i32,
7262 alt: 0_i32,
7263 relative_alt: 0_i32,
7264 q: [0.0_f32; 4usize],
7265 image_index: 0_i32,
7266 camera_id: 0_u8,
7267 capture_result: 0_i8,
7268 file_url: CharArray::new([0_u8; 205usize]),
7269 };
7270 #[cfg(feature = "arbitrary")]
7271 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7272 use arbitrary::{Arbitrary, Unstructured};
7273 let mut buf = [0u8; 1024];
7274 rng.fill_bytes(&mut buf);
7275 let mut unstructured = Unstructured::new(&buf);
7276 Self::arbitrary(&mut unstructured).unwrap_or_default()
7277 }
7278}
7279impl Default for CAMERA_IMAGE_CAPTURED_DATA {
7280 fn default() -> Self {
7281 Self::DEFAULT.clone()
7282 }
7283}
7284impl MessageData for CAMERA_IMAGE_CAPTURED_DATA {
7285 type Message = MavMessage;
7286 const ID: u32 = 263u32;
7287 const NAME: &'static str = "CAMERA_IMAGE_CAPTURED";
7288 const EXTRA_CRC: u8 = 133u8;
7289 const ENCODED_LEN: usize = 255usize;
7290 fn deser(
7291 _version: MavlinkVersion,
7292 __input: &[u8],
7293 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7294 let avail_len = __input.len();
7295 let mut payload_buf = [0; Self::ENCODED_LEN];
7296 let mut buf = if avail_len < Self::ENCODED_LEN {
7297 payload_buf[0..avail_len].copy_from_slice(__input);
7298 Bytes::new(&payload_buf)
7299 } else {
7300 Bytes::new(__input)
7301 };
7302 let mut __struct = Self::default();
7303 __struct.time_utc = buf.get_u64_le();
7304 __struct.time_boot_ms = buf.get_u32_le();
7305 __struct.lat = buf.get_i32_le();
7306 __struct.lon = buf.get_i32_le();
7307 __struct.alt = buf.get_i32_le();
7308 __struct.relative_alt = buf.get_i32_le();
7309 for v in &mut __struct.q {
7310 let val = buf.get_f32_le();
7311 *v = val;
7312 }
7313 __struct.image_index = buf.get_i32_le();
7314 __struct.camera_id = buf.get_u8();
7315 __struct.capture_result = buf.get_i8();
7316 let mut tmp = [0_u8; 205usize];
7317 for v in &mut tmp {
7318 *v = buf.get_u8();
7319 }
7320 __struct.file_url = CharArray::new(tmp);
7321 Ok(__struct)
7322 }
7323 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7324 let mut __tmp = BytesMut::new(bytes);
7325 #[allow(clippy::absurd_extreme_comparisons)]
7326 #[allow(unused_comparisons)]
7327 if __tmp.remaining() < Self::ENCODED_LEN {
7328 panic!(
7329 "buffer is too small (need {} bytes, but got {})",
7330 Self::ENCODED_LEN,
7331 __tmp.remaining(),
7332 )
7333 }
7334 __tmp.put_u64_le(self.time_utc);
7335 __tmp.put_u32_le(self.time_boot_ms);
7336 __tmp.put_i32_le(self.lat);
7337 __tmp.put_i32_le(self.lon);
7338 __tmp.put_i32_le(self.alt);
7339 __tmp.put_i32_le(self.relative_alt);
7340 for val in &self.q {
7341 __tmp.put_f32_le(*val);
7342 }
7343 __tmp.put_i32_le(self.image_index);
7344 __tmp.put_u8(self.camera_id);
7345 __tmp.put_i8(self.capture_result);
7346 for val in &self.file_url {
7347 __tmp.put_u8(*val);
7348 }
7349 if matches!(version, MavlinkVersion::V2) {
7350 let len = __tmp.len();
7351 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7352 } else {
7353 __tmp.len()
7354 }
7355 }
7356}
7357#[doc = "Information about a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
7358#[doc = ""]
7359#[doc = "ID: 259"]
7360#[derive(Debug, Clone, PartialEq)]
7361#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7362#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7363#[cfg_attr(feature = "ts", derive(TS))]
7364#[cfg_attr(feature = "ts", ts(export))]
7365pub struct CAMERA_INFORMATION_DATA {
7366 #[doc = "Timestamp (time since system boot)."]
7367 pub time_boot_ms: u32,
7368 #[doc = "0xff). Use 0 if not known."]
7369 pub firmware_version: u32,
7370 #[doc = "Focal length. Use NaN if not known."]
7371 pub focal_length: f32,
7372 #[doc = "Image sensor size horizontal. Use NaN if not known."]
7373 pub sensor_size_h: f32,
7374 #[doc = "Image sensor size vertical. Use NaN if not known."]
7375 pub sensor_size_v: f32,
7376 #[doc = "Bitmap of camera capability flags."]
7377 pub flags: CameraCapFlags,
7378 #[doc = "Horizontal image resolution. Use 0 if not known."]
7379 pub resolution_h: u16,
7380 #[doc = "Vertical image resolution. Use 0 if not known."]
7381 pub resolution_v: u16,
7382 #[doc = "Camera definition version (iteration). Use 0 if not known."]
7383 pub cam_definition_version: u16,
7384 #[doc = "Name of the camera vendor"]
7385 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7386 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7387 pub vendor_name: [u8; 32],
7388 #[doc = "Name of the camera model"]
7389 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7390 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7391 pub model_name: [u8; 32],
7392 #[doc = "Reserved for a lens ID. Use 0 if not known."]
7393 pub lens_id: u8,
7394 #[doc = "Camera definition URI (if any, otherwise only basic functions will be available). HTTP- (http://) and MAVLink FTP- (mavlinkftp://) formatted URIs are allowed (and both must be supported by any GCS that implements the Camera Protocol). The definition file may be xz compressed, which will be indicated by the file extension .xml.xz (a GCS that implements the protocol must support decompressing the file). The string needs to be zero terminated. Use a zero-length string if not known."]
7395 #[cfg_attr(feature = "ts", ts(type = "string"))]
7396 pub cam_definition_uri: CharArray<140>,
7397 #[doc = "Gimbal id of a gimbal associated with this camera. This is the component id of the gimbal device, or 1-6 for non mavlink gimbals. Use 0 if no gimbal is associated with the camera."]
7398 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7399 pub gimbal_device_id: u8,
7400 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7401 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7402 pub camera_device_id: u8,
7403}
7404impl CAMERA_INFORMATION_DATA {
7405 pub const ENCODED_LEN: usize = 237usize;
7406 pub const DEFAULT: Self = Self {
7407 time_boot_ms: 0_u32,
7408 firmware_version: 0_u32,
7409 focal_length: 0.0_f32,
7410 sensor_size_h: 0.0_f32,
7411 sensor_size_v: 0.0_f32,
7412 flags: CameraCapFlags::DEFAULT,
7413 resolution_h: 0_u16,
7414 resolution_v: 0_u16,
7415 cam_definition_version: 0_u16,
7416 vendor_name: [0_u8; 32usize],
7417 model_name: [0_u8; 32usize],
7418 lens_id: 0_u8,
7419 cam_definition_uri: CharArray::new([0_u8; 140usize]),
7420 gimbal_device_id: 0_u8,
7421 camera_device_id: 0_u8,
7422 };
7423 #[cfg(feature = "arbitrary")]
7424 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7425 use arbitrary::{Arbitrary, Unstructured};
7426 let mut buf = [0u8; 1024];
7427 rng.fill_bytes(&mut buf);
7428 let mut unstructured = Unstructured::new(&buf);
7429 Self::arbitrary(&mut unstructured).unwrap_or_default()
7430 }
7431}
7432impl Default for CAMERA_INFORMATION_DATA {
7433 fn default() -> Self {
7434 Self::DEFAULT.clone()
7435 }
7436}
7437impl MessageData for CAMERA_INFORMATION_DATA {
7438 type Message = MavMessage;
7439 const ID: u32 = 259u32;
7440 const NAME: &'static str = "CAMERA_INFORMATION";
7441 const EXTRA_CRC: u8 = 92u8;
7442 const ENCODED_LEN: usize = 237usize;
7443 fn deser(
7444 _version: MavlinkVersion,
7445 __input: &[u8],
7446 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7447 let avail_len = __input.len();
7448 let mut payload_buf = [0; Self::ENCODED_LEN];
7449 let mut buf = if avail_len < Self::ENCODED_LEN {
7450 payload_buf[0..avail_len].copy_from_slice(__input);
7451 Bytes::new(&payload_buf)
7452 } else {
7453 Bytes::new(__input)
7454 };
7455 let mut __struct = Self::default();
7456 __struct.time_boot_ms = buf.get_u32_le();
7457 __struct.firmware_version = buf.get_u32_le();
7458 __struct.focal_length = buf.get_f32_le();
7459 __struct.sensor_size_h = buf.get_f32_le();
7460 __struct.sensor_size_v = buf.get_f32_le();
7461 let tmp = buf.get_u32_le();
7462 __struct.flags = CameraCapFlags::from_bits(tmp).ok_or(
7463 ::mavlink_core::error::ParserError::InvalidFlag {
7464 flag_type: "CameraCapFlags",
7465 value: tmp as u64,
7466 },
7467 )?;
7468 __struct.resolution_h = buf.get_u16_le();
7469 __struct.resolution_v = buf.get_u16_le();
7470 __struct.cam_definition_version = buf.get_u16_le();
7471 for v in &mut __struct.vendor_name {
7472 let val = buf.get_u8();
7473 *v = val;
7474 }
7475 for v in &mut __struct.model_name {
7476 let val = buf.get_u8();
7477 *v = val;
7478 }
7479 __struct.lens_id = buf.get_u8();
7480 let mut tmp = [0_u8; 140usize];
7481 for v in &mut tmp {
7482 *v = buf.get_u8();
7483 }
7484 __struct.cam_definition_uri = CharArray::new(tmp);
7485 __struct.gimbal_device_id = buf.get_u8();
7486 __struct.camera_device_id = buf.get_u8();
7487 Ok(__struct)
7488 }
7489 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7490 let mut __tmp = BytesMut::new(bytes);
7491 #[allow(clippy::absurd_extreme_comparisons)]
7492 #[allow(unused_comparisons)]
7493 if __tmp.remaining() < Self::ENCODED_LEN {
7494 panic!(
7495 "buffer is too small (need {} bytes, but got {})",
7496 Self::ENCODED_LEN,
7497 __tmp.remaining(),
7498 )
7499 }
7500 __tmp.put_u32_le(self.time_boot_ms);
7501 __tmp.put_u32_le(self.firmware_version);
7502 __tmp.put_f32_le(self.focal_length);
7503 __tmp.put_f32_le(self.sensor_size_h);
7504 __tmp.put_f32_le(self.sensor_size_v);
7505 __tmp.put_u32_le(self.flags.bits());
7506 __tmp.put_u16_le(self.resolution_h);
7507 __tmp.put_u16_le(self.resolution_v);
7508 __tmp.put_u16_le(self.cam_definition_version);
7509 for val in &self.vendor_name {
7510 __tmp.put_u8(*val);
7511 }
7512 for val in &self.model_name {
7513 __tmp.put_u8(*val);
7514 }
7515 __tmp.put_u8(self.lens_id);
7516 for val in &self.cam_definition_uri {
7517 __tmp.put_u8(*val);
7518 }
7519 if matches!(version, MavlinkVersion::V2) {
7520 __tmp.put_u8(self.gimbal_device_id);
7521 __tmp.put_u8(self.camera_device_id);
7522 let len = __tmp.len();
7523 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7524 } else {
7525 __tmp.len()
7526 }
7527 }
7528}
7529#[doc = "Settings of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
7530#[doc = ""]
7531#[doc = "ID: 260"]
7532#[derive(Debug, Clone, PartialEq)]
7533#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7534#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7535#[cfg_attr(feature = "ts", derive(TS))]
7536#[cfg_attr(feature = "ts", ts(export))]
7537pub struct CAMERA_SETTINGS_DATA {
7538 #[doc = "Timestamp (time since system boot)."]
7539 pub time_boot_ms: u32,
7540 #[doc = "Camera mode"]
7541 pub mode_id: CameraMode,
7542 #[doc = "Current zoom level as a percentage of the full range (0.0 to 100.0, NaN if not known)"]
7543 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7544 pub zoomLevel: f32,
7545 #[doc = "Current focus level as a percentage of the full range (0.0 to 100.0, NaN if not known)"]
7546 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7547 pub focusLevel: f32,
7548 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7549 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7550 pub camera_device_id: u8,
7551}
7552impl CAMERA_SETTINGS_DATA {
7553 pub const ENCODED_LEN: usize = 14usize;
7554 pub const DEFAULT: Self = Self {
7555 time_boot_ms: 0_u32,
7556 mode_id: CameraMode::DEFAULT,
7557 zoomLevel: 0.0_f32,
7558 focusLevel: 0.0_f32,
7559 camera_device_id: 0_u8,
7560 };
7561 #[cfg(feature = "arbitrary")]
7562 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7563 use arbitrary::{Arbitrary, Unstructured};
7564 let mut buf = [0u8; 1024];
7565 rng.fill_bytes(&mut buf);
7566 let mut unstructured = Unstructured::new(&buf);
7567 Self::arbitrary(&mut unstructured).unwrap_or_default()
7568 }
7569}
7570impl Default for CAMERA_SETTINGS_DATA {
7571 fn default() -> Self {
7572 Self::DEFAULT.clone()
7573 }
7574}
7575impl MessageData for CAMERA_SETTINGS_DATA {
7576 type Message = MavMessage;
7577 const ID: u32 = 260u32;
7578 const NAME: &'static str = "CAMERA_SETTINGS";
7579 const EXTRA_CRC: u8 = 146u8;
7580 const ENCODED_LEN: usize = 14usize;
7581 fn deser(
7582 _version: MavlinkVersion,
7583 __input: &[u8],
7584 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7585 let avail_len = __input.len();
7586 let mut payload_buf = [0; Self::ENCODED_LEN];
7587 let mut buf = if avail_len < Self::ENCODED_LEN {
7588 payload_buf[0..avail_len].copy_from_slice(__input);
7589 Bytes::new(&payload_buf)
7590 } else {
7591 Bytes::new(__input)
7592 };
7593 let mut __struct = Self::default();
7594 __struct.time_boot_ms = buf.get_u32_le();
7595 let tmp = buf.get_u8();
7596 __struct.mode_id =
7597 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7598 enum_type: "CameraMode",
7599 value: tmp as u64,
7600 })?;
7601 __struct.zoomLevel = buf.get_f32_le();
7602 __struct.focusLevel = buf.get_f32_le();
7603 __struct.camera_device_id = buf.get_u8();
7604 Ok(__struct)
7605 }
7606 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7607 let mut __tmp = BytesMut::new(bytes);
7608 #[allow(clippy::absurd_extreme_comparisons)]
7609 #[allow(unused_comparisons)]
7610 if __tmp.remaining() < Self::ENCODED_LEN {
7611 panic!(
7612 "buffer is too small (need {} bytes, but got {})",
7613 Self::ENCODED_LEN,
7614 __tmp.remaining(),
7615 )
7616 }
7617 __tmp.put_u32_le(self.time_boot_ms);
7618 __tmp.put_u8(self.mode_id as u8);
7619 if matches!(version, MavlinkVersion::V2) {
7620 __tmp.put_f32_le(self.zoomLevel);
7621 __tmp.put_f32_le(self.focusLevel);
7622 __tmp.put_u8(self.camera_device_id);
7623 let len = __tmp.len();
7624 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7625 } else {
7626 __tmp.len()
7627 }
7628 }
7629}
7630#[doc = "Camera absolute thermal range. This can be streamed when the associated VIDEO_STREAM_STATUS `flag` field bit VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED is set, but a GCS may choose to only request it for the current active stream. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval (param3 indicates the stream id of the current camera, or 0 for all streams, param4 indicates the target camera_device_id for autopilot-attached cameras or 0 for MAVLink cameras)."]
7631#[doc = ""]
7632#[doc = "ID: 277"]
7633#[derive(Debug, Clone, PartialEq)]
7634#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7635#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7636#[cfg_attr(feature = "ts", derive(TS))]
7637#[cfg_attr(feature = "ts", ts(export))]
7638pub struct CAMERA_THERMAL_RANGE_DATA {
7639 #[doc = "Timestamp (time since system boot)."]
7640 pub time_boot_ms: u32,
7641 #[doc = "Temperature max."]
7642 pub max: f32,
7643 #[doc = "Temperature max point x value (normalized 0..1, 0 is left, 1 is right), NAN if unknown."]
7644 pub max_point_x: f32,
7645 #[doc = "Temperature max point y value (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown."]
7646 pub max_point_y: f32,
7647 #[doc = "Temperature min."]
7648 pub min: f32,
7649 #[doc = "Temperature min point x value (normalized 0..1, 0 is left, 1 is right), NAN if unknown."]
7650 pub min_point_x: f32,
7651 #[doc = "Temperature min point y value (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown."]
7652 pub min_point_y: f32,
7653 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
7654 pub stream_id: u8,
7655 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7656 pub camera_device_id: u8,
7657}
7658impl CAMERA_THERMAL_RANGE_DATA {
7659 pub const ENCODED_LEN: usize = 30usize;
7660 pub const DEFAULT: Self = Self {
7661 time_boot_ms: 0_u32,
7662 max: 0.0_f32,
7663 max_point_x: 0.0_f32,
7664 max_point_y: 0.0_f32,
7665 min: 0.0_f32,
7666 min_point_x: 0.0_f32,
7667 min_point_y: 0.0_f32,
7668 stream_id: 0_u8,
7669 camera_device_id: 0_u8,
7670 };
7671 #[cfg(feature = "arbitrary")]
7672 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7673 use arbitrary::{Arbitrary, Unstructured};
7674 let mut buf = [0u8; 1024];
7675 rng.fill_bytes(&mut buf);
7676 let mut unstructured = Unstructured::new(&buf);
7677 Self::arbitrary(&mut unstructured).unwrap_or_default()
7678 }
7679}
7680impl Default for CAMERA_THERMAL_RANGE_DATA {
7681 fn default() -> Self {
7682 Self::DEFAULT.clone()
7683 }
7684}
7685impl MessageData for CAMERA_THERMAL_RANGE_DATA {
7686 type Message = MavMessage;
7687 const ID: u32 = 277u32;
7688 const NAME: &'static str = "CAMERA_THERMAL_RANGE";
7689 const EXTRA_CRC: u8 = 62u8;
7690 const ENCODED_LEN: usize = 30usize;
7691 fn deser(
7692 _version: MavlinkVersion,
7693 __input: &[u8],
7694 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7695 let avail_len = __input.len();
7696 let mut payload_buf = [0; Self::ENCODED_LEN];
7697 let mut buf = if avail_len < Self::ENCODED_LEN {
7698 payload_buf[0..avail_len].copy_from_slice(__input);
7699 Bytes::new(&payload_buf)
7700 } else {
7701 Bytes::new(__input)
7702 };
7703 let mut __struct = Self::default();
7704 __struct.time_boot_ms = buf.get_u32_le();
7705 __struct.max = buf.get_f32_le();
7706 __struct.max_point_x = buf.get_f32_le();
7707 __struct.max_point_y = buf.get_f32_le();
7708 __struct.min = buf.get_f32_le();
7709 __struct.min_point_x = buf.get_f32_le();
7710 __struct.min_point_y = buf.get_f32_le();
7711 __struct.stream_id = buf.get_u8();
7712 __struct.camera_device_id = buf.get_u8();
7713 Ok(__struct)
7714 }
7715 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7716 let mut __tmp = BytesMut::new(bytes);
7717 #[allow(clippy::absurd_extreme_comparisons)]
7718 #[allow(unused_comparisons)]
7719 if __tmp.remaining() < Self::ENCODED_LEN {
7720 panic!(
7721 "buffer is too small (need {} bytes, but got {})",
7722 Self::ENCODED_LEN,
7723 __tmp.remaining(),
7724 )
7725 }
7726 __tmp.put_u32_le(self.time_boot_ms);
7727 __tmp.put_f32_le(self.max);
7728 __tmp.put_f32_le(self.max_point_x);
7729 __tmp.put_f32_le(self.max_point_y);
7730 __tmp.put_f32_le(self.min);
7731 __tmp.put_f32_le(self.min_point_x);
7732 __tmp.put_f32_le(self.min_point_y);
7733 __tmp.put_u8(self.stream_id);
7734 __tmp.put_u8(self.camera_device_id);
7735 if matches!(version, MavlinkVersion::V2) {
7736 let len = __tmp.len();
7737 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7738 } else {
7739 __tmp.len()
7740 }
7741 }
7742}
7743#[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
7744#[doc = ""]
7745#[doc = "ID: 276"]
7746#[derive(Debug, Clone, PartialEq)]
7747#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7748#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7749#[cfg_attr(feature = "ts", derive(TS))]
7750#[cfg_attr(feature = "ts", ts(export))]
7751pub struct CAMERA_TRACKING_GEO_STATUS_DATA {
7752 #[doc = "Latitude of tracked object"]
7753 pub lat: i32,
7754 #[doc = "Longitude of tracked object"]
7755 pub lon: i32,
7756 #[doc = "Altitude of tracked object(AMSL, WGS84)"]
7757 pub alt: f32,
7758 #[doc = "Horizontal accuracy. NAN if unknown"]
7759 pub h_acc: f32,
7760 #[doc = "Vertical accuracy. NAN if unknown"]
7761 pub v_acc: f32,
7762 #[doc = "North velocity of tracked object. NAN if unknown"]
7763 pub vel_n: f32,
7764 #[doc = "East velocity of tracked object. NAN if unknown"]
7765 pub vel_e: f32,
7766 #[doc = "Down velocity of tracked object. NAN if unknown"]
7767 pub vel_d: f32,
7768 #[doc = "Velocity accuracy. NAN if unknown"]
7769 pub vel_acc: f32,
7770 #[doc = "Distance between camera and tracked object. NAN if unknown"]
7771 pub dist: f32,
7772 #[doc = "Heading in radians, in NED. NAN if unknown"]
7773 pub hdg: f32,
7774 #[doc = "Accuracy of heading, in NED. NAN if unknown"]
7775 pub hdg_acc: f32,
7776 #[doc = "Current tracking status"]
7777 pub tracking_status: CameraTrackingStatusFlags,
7778 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7779 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7780 pub camera_device_id: u8,
7781}
7782impl CAMERA_TRACKING_GEO_STATUS_DATA {
7783 pub const ENCODED_LEN: usize = 50usize;
7784 pub const DEFAULT: Self = Self {
7785 lat: 0_i32,
7786 lon: 0_i32,
7787 alt: 0.0_f32,
7788 h_acc: 0.0_f32,
7789 v_acc: 0.0_f32,
7790 vel_n: 0.0_f32,
7791 vel_e: 0.0_f32,
7792 vel_d: 0.0_f32,
7793 vel_acc: 0.0_f32,
7794 dist: 0.0_f32,
7795 hdg: 0.0_f32,
7796 hdg_acc: 0.0_f32,
7797 tracking_status: CameraTrackingStatusFlags::DEFAULT,
7798 camera_device_id: 0_u8,
7799 };
7800 #[cfg(feature = "arbitrary")]
7801 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7802 use arbitrary::{Arbitrary, Unstructured};
7803 let mut buf = [0u8; 1024];
7804 rng.fill_bytes(&mut buf);
7805 let mut unstructured = Unstructured::new(&buf);
7806 Self::arbitrary(&mut unstructured).unwrap_or_default()
7807 }
7808}
7809impl Default for CAMERA_TRACKING_GEO_STATUS_DATA {
7810 fn default() -> Self {
7811 Self::DEFAULT.clone()
7812 }
7813}
7814impl MessageData for CAMERA_TRACKING_GEO_STATUS_DATA {
7815 type Message = MavMessage;
7816 const ID: u32 = 276u32;
7817 const NAME: &'static str = "CAMERA_TRACKING_GEO_STATUS";
7818 const EXTRA_CRC: u8 = 18u8;
7819 const ENCODED_LEN: usize = 50usize;
7820 fn deser(
7821 _version: MavlinkVersion,
7822 __input: &[u8],
7823 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7824 let avail_len = __input.len();
7825 let mut payload_buf = [0; Self::ENCODED_LEN];
7826 let mut buf = if avail_len < Self::ENCODED_LEN {
7827 payload_buf[0..avail_len].copy_from_slice(__input);
7828 Bytes::new(&payload_buf)
7829 } else {
7830 Bytes::new(__input)
7831 };
7832 let mut __struct = Self::default();
7833 __struct.lat = buf.get_i32_le();
7834 __struct.lon = buf.get_i32_le();
7835 __struct.alt = buf.get_f32_le();
7836 __struct.h_acc = buf.get_f32_le();
7837 __struct.v_acc = buf.get_f32_le();
7838 __struct.vel_n = buf.get_f32_le();
7839 __struct.vel_e = buf.get_f32_le();
7840 __struct.vel_d = buf.get_f32_le();
7841 __struct.vel_acc = buf.get_f32_le();
7842 __struct.dist = buf.get_f32_le();
7843 __struct.hdg = buf.get_f32_le();
7844 __struct.hdg_acc = buf.get_f32_le();
7845 let tmp = buf.get_u8();
7846 __struct.tracking_status =
7847 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7848 enum_type: "CameraTrackingStatusFlags",
7849 value: tmp as u64,
7850 })?;
7851 __struct.camera_device_id = buf.get_u8();
7852 Ok(__struct)
7853 }
7854 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7855 let mut __tmp = BytesMut::new(bytes);
7856 #[allow(clippy::absurd_extreme_comparisons)]
7857 #[allow(unused_comparisons)]
7858 if __tmp.remaining() < Self::ENCODED_LEN {
7859 panic!(
7860 "buffer is too small (need {} bytes, but got {})",
7861 Self::ENCODED_LEN,
7862 __tmp.remaining(),
7863 )
7864 }
7865 __tmp.put_i32_le(self.lat);
7866 __tmp.put_i32_le(self.lon);
7867 __tmp.put_f32_le(self.alt);
7868 __tmp.put_f32_le(self.h_acc);
7869 __tmp.put_f32_le(self.v_acc);
7870 __tmp.put_f32_le(self.vel_n);
7871 __tmp.put_f32_le(self.vel_e);
7872 __tmp.put_f32_le(self.vel_d);
7873 __tmp.put_f32_le(self.vel_acc);
7874 __tmp.put_f32_le(self.dist);
7875 __tmp.put_f32_le(self.hdg);
7876 __tmp.put_f32_le(self.hdg_acc);
7877 __tmp.put_u8(self.tracking_status as u8);
7878 if matches!(version, MavlinkVersion::V2) {
7879 __tmp.put_u8(self.camera_device_id);
7880 let len = __tmp.len();
7881 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7882 } else {
7883 __tmp.len()
7884 }
7885 }
7886}
7887#[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
7888#[doc = ""]
7889#[doc = "ID: 275"]
7890#[derive(Debug, Clone, PartialEq)]
7891#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7892#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7893#[cfg_attr(feature = "ts", derive(TS))]
7894#[cfg_attr(feature = "ts", ts(export))]
7895pub struct CAMERA_TRACKING_IMAGE_STATUS_DATA {
7896 #[doc = "Current tracked point x value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
7897 pub point_x: f32,
7898 #[doc = "Current tracked point y value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
7899 pub point_y: f32,
7900 #[doc = "Current tracked radius if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is image left, 1 is image right), NAN if unknown"]
7901 pub radius: f32,
7902 #[doc = "Current tracked rectangle top x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
7903 pub rec_top_x: f32,
7904 #[doc = "Current tracked rectangle top y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
7905 pub rec_top_y: f32,
7906 #[doc = "Current tracked rectangle bottom x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
7907 pub rec_bottom_x: f32,
7908 #[doc = "Current tracked rectangle bottom y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
7909 pub rec_bottom_y: f32,
7910 #[doc = "Current tracking status"]
7911 pub tracking_status: CameraTrackingStatusFlags,
7912 #[doc = "Current tracking mode"]
7913 pub tracking_mode: CameraTrackingMode,
7914 #[doc = "Defines location of target data"]
7915 pub target_data: CameraTrackingTargetData,
7916 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7917 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7918 pub camera_device_id: u8,
7919}
7920impl CAMERA_TRACKING_IMAGE_STATUS_DATA {
7921 pub const ENCODED_LEN: usize = 32usize;
7922 pub const DEFAULT: Self = Self {
7923 point_x: 0.0_f32,
7924 point_y: 0.0_f32,
7925 radius: 0.0_f32,
7926 rec_top_x: 0.0_f32,
7927 rec_top_y: 0.0_f32,
7928 rec_bottom_x: 0.0_f32,
7929 rec_bottom_y: 0.0_f32,
7930 tracking_status: CameraTrackingStatusFlags::DEFAULT,
7931 tracking_mode: CameraTrackingMode::DEFAULT,
7932 target_data: CameraTrackingTargetData::DEFAULT,
7933 camera_device_id: 0_u8,
7934 };
7935 #[cfg(feature = "arbitrary")]
7936 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7937 use arbitrary::{Arbitrary, Unstructured};
7938 let mut buf = [0u8; 1024];
7939 rng.fill_bytes(&mut buf);
7940 let mut unstructured = Unstructured::new(&buf);
7941 Self::arbitrary(&mut unstructured).unwrap_or_default()
7942 }
7943}
7944impl Default for CAMERA_TRACKING_IMAGE_STATUS_DATA {
7945 fn default() -> Self {
7946 Self::DEFAULT.clone()
7947 }
7948}
7949impl MessageData for CAMERA_TRACKING_IMAGE_STATUS_DATA {
7950 type Message = MavMessage;
7951 const ID: u32 = 275u32;
7952 const NAME: &'static str = "CAMERA_TRACKING_IMAGE_STATUS";
7953 const EXTRA_CRC: u8 = 126u8;
7954 const ENCODED_LEN: usize = 32usize;
7955 fn deser(
7956 _version: MavlinkVersion,
7957 __input: &[u8],
7958 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7959 let avail_len = __input.len();
7960 let mut payload_buf = [0; Self::ENCODED_LEN];
7961 let mut buf = if avail_len < Self::ENCODED_LEN {
7962 payload_buf[0..avail_len].copy_from_slice(__input);
7963 Bytes::new(&payload_buf)
7964 } else {
7965 Bytes::new(__input)
7966 };
7967 let mut __struct = Self::default();
7968 __struct.point_x = buf.get_f32_le();
7969 __struct.point_y = buf.get_f32_le();
7970 __struct.radius = buf.get_f32_le();
7971 __struct.rec_top_x = buf.get_f32_le();
7972 __struct.rec_top_y = buf.get_f32_le();
7973 __struct.rec_bottom_x = buf.get_f32_le();
7974 __struct.rec_bottom_y = buf.get_f32_le();
7975 let tmp = buf.get_u8();
7976 __struct.tracking_status =
7977 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7978 enum_type: "CameraTrackingStatusFlags",
7979 value: tmp as u64,
7980 })?;
7981 let tmp = buf.get_u8();
7982 __struct.tracking_mode =
7983 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7984 enum_type: "CameraTrackingMode",
7985 value: tmp as u64,
7986 })?;
7987 let tmp = buf.get_u8();
7988 __struct.target_data = CameraTrackingTargetData::from_bits(tmp).ok_or(
7989 ::mavlink_core::error::ParserError::InvalidFlag {
7990 flag_type: "CameraTrackingTargetData",
7991 value: tmp as u64,
7992 },
7993 )?;
7994 __struct.camera_device_id = buf.get_u8();
7995 Ok(__struct)
7996 }
7997 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7998 let mut __tmp = BytesMut::new(bytes);
7999 #[allow(clippy::absurd_extreme_comparisons)]
8000 #[allow(unused_comparisons)]
8001 if __tmp.remaining() < Self::ENCODED_LEN {
8002 panic!(
8003 "buffer is too small (need {} bytes, but got {})",
8004 Self::ENCODED_LEN,
8005 __tmp.remaining(),
8006 )
8007 }
8008 __tmp.put_f32_le(self.point_x);
8009 __tmp.put_f32_le(self.point_y);
8010 __tmp.put_f32_le(self.radius);
8011 __tmp.put_f32_le(self.rec_top_x);
8012 __tmp.put_f32_le(self.rec_top_y);
8013 __tmp.put_f32_le(self.rec_bottom_x);
8014 __tmp.put_f32_le(self.rec_bottom_y);
8015 __tmp.put_u8(self.tracking_status as u8);
8016 __tmp.put_u8(self.tracking_mode as u8);
8017 __tmp.put_u8(self.target_data.bits());
8018 if matches!(version, MavlinkVersion::V2) {
8019 __tmp.put_u8(self.camera_device_id);
8020 let len = __tmp.len();
8021 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8022 } else {
8023 __tmp.len()
8024 }
8025 }
8026}
8027#[doc = "Camera-IMU triggering and synchronisation message."]
8028#[doc = ""]
8029#[doc = "ID: 112"]
8030#[derive(Debug, Clone, PartialEq)]
8031#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8032#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8033#[cfg_attr(feature = "ts", derive(TS))]
8034#[cfg_attr(feature = "ts", ts(export))]
8035pub struct CAMERA_TRIGGER_DATA {
8036 #[doc = "Timestamp for image frame (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
8037 pub time_usec: u64,
8038 #[doc = "Image frame sequence"]
8039 pub seq: u32,
8040}
8041impl CAMERA_TRIGGER_DATA {
8042 pub const ENCODED_LEN: usize = 12usize;
8043 pub const DEFAULT: Self = Self {
8044 time_usec: 0_u64,
8045 seq: 0_u32,
8046 };
8047 #[cfg(feature = "arbitrary")]
8048 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8049 use arbitrary::{Arbitrary, Unstructured};
8050 let mut buf = [0u8; 1024];
8051 rng.fill_bytes(&mut buf);
8052 let mut unstructured = Unstructured::new(&buf);
8053 Self::arbitrary(&mut unstructured).unwrap_or_default()
8054 }
8055}
8056impl Default for CAMERA_TRIGGER_DATA {
8057 fn default() -> Self {
8058 Self::DEFAULT.clone()
8059 }
8060}
8061impl MessageData for CAMERA_TRIGGER_DATA {
8062 type Message = MavMessage;
8063 const ID: u32 = 112u32;
8064 const NAME: &'static str = "CAMERA_TRIGGER";
8065 const EXTRA_CRC: u8 = 174u8;
8066 const ENCODED_LEN: usize = 12usize;
8067 fn deser(
8068 _version: MavlinkVersion,
8069 __input: &[u8],
8070 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8071 let avail_len = __input.len();
8072 let mut payload_buf = [0; Self::ENCODED_LEN];
8073 let mut buf = if avail_len < Self::ENCODED_LEN {
8074 payload_buf[0..avail_len].copy_from_slice(__input);
8075 Bytes::new(&payload_buf)
8076 } else {
8077 Bytes::new(__input)
8078 };
8079 let mut __struct = Self::default();
8080 __struct.time_usec = buf.get_u64_le();
8081 __struct.seq = buf.get_u32_le();
8082 Ok(__struct)
8083 }
8084 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8085 let mut __tmp = BytesMut::new(bytes);
8086 #[allow(clippy::absurd_extreme_comparisons)]
8087 #[allow(unused_comparisons)]
8088 if __tmp.remaining() < Self::ENCODED_LEN {
8089 panic!(
8090 "buffer is too small (need {} bytes, but got {})",
8091 Self::ENCODED_LEN,
8092 __tmp.remaining(),
8093 )
8094 }
8095 __tmp.put_u64_le(self.time_usec);
8096 __tmp.put_u32_le(self.seq);
8097 if matches!(version, MavlinkVersion::V2) {
8098 let len = __tmp.len();
8099 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8100 } else {
8101 __tmp.len()
8102 }
8103 }
8104}
8105#[doc = "A forwarded CANFD frame as requested by MAV_CMD_CAN_FORWARD. These are separated from CAN_FRAME as they need different handling (eg. TAO handling)."]
8106#[doc = ""]
8107#[doc = "ID: 387"]
8108#[derive(Debug, Clone, PartialEq)]
8109#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8110#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8111#[cfg_attr(feature = "ts", derive(TS))]
8112#[cfg_attr(feature = "ts", ts(export))]
8113pub struct CANFD_FRAME_DATA {
8114 #[doc = "Frame ID"]
8115 pub id: u32,
8116 #[doc = "System ID."]
8117 pub target_system: u8,
8118 #[doc = "Component ID."]
8119 pub target_component: u8,
8120 #[doc = "bus number"]
8121 pub bus: u8,
8122 #[doc = "Frame length"]
8123 pub len: u8,
8124 #[doc = "Frame data"]
8125 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8126 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
8127 pub data: [u8; 64],
8128}
8129impl CANFD_FRAME_DATA {
8130 pub const ENCODED_LEN: usize = 72usize;
8131 pub const DEFAULT: Self = Self {
8132 id: 0_u32,
8133 target_system: 0_u8,
8134 target_component: 0_u8,
8135 bus: 0_u8,
8136 len: 0_u8,
8137 data: [0_u8; 64usize],
8138 };
8139 #[cfg(feature = "arbitrary")]
8140 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8141 use arbitrary::{Arbitrary, Unstructured};
8142 let mut buf = [0u8; 1024];
8143 rng.fill_bytes(&mut buf);
8144 let mut unstructured = Unstructured::new(&buf);
8145 Self::arbitrary(&mut unstructured).unwrap_or_default()
8146 }
8147}
8148impl Default for CANFD_FRAME_DATA {
8149 fn default() -> Self {
8150 Self::DEFAULT.clone()
8151 }
8152}
8153impl MessageData for CANFD_FRAME_DATA {
8154 type Message = MavMessage;
8155 const ID: u32 = 387u32;
8156 const NAME: &'static str = "CANFD_FRAME";
8157 const EXTRA_CRC: u8 = 4u8;
8158 const ENCODED_LEN: usize = 72usize;
8159 fn deser(
8160 _version: MavlinkVersion,
8161 __input: &[u8],
8162 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8163 let avail_len = __input.len();
8164 let mut payload_buf = [0; Self::ENCODED_LEN];
8165 let mut buf = if avail_len < Self::ENCODED_LEN {
8166 payload_buf[0..avail_len].copy_from_slice(__input);
8167 Bytes::new(&payload_buf)
8168 } else {
8169 Bytes::new(__input)
8170 };
8171 let mut __struct = Self::default();
8172 __struct.id = buf.get_u32_le();
8173 __struct.target_system = buf.get_u8();
8174 __struct.target_component = buf.get_u8();
8175 __struct.bus = buf.get_u8();
8176 __struct.len = buf.get_u8();
8177 for v in &mut __struct.data {
8178 let val = buf.get_u8();
8179 *v = val;
8180 }
8181 Ok(__struct)
8182 }
8183 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8184 let mut __tmp = BytesMut::new(bytes);
8185 #[allow(clippy::absurd_extreme_comparisons)]
8186 #[allow(unused_comparisons)]
8187 if __tmp.remaining() < Self::ENCODED_LEN {
8188 panic!(
8189 "buffer is too small (need {} bytes, but got {})",
8190 Self::ENCODED_LEN,
8191 __tmp.remaining(),
8192 )
8193 }
8194 __tmp.put_u32_le(self.id);
8195 __tmp.put_u8(self.target_system);
8196 __tmp.put_u8(self.target_component);
8197 __tmp.put_u8(self.bus);
8198 __tmp.put_u8(self.len);
8199 for val in &self.data {
8200 __tmp.put_u8(*val);
8201 }
8202 if matches!(version, MavlinkVersion::V2) {
8203 let len = __tmp.len();
8204 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8205 } else {
8206 __tmp.len()
8207 }
8208 }
8209}
8210#[doc = "Modify the filter of what CAN messages to forward over the mavlink. This can be used to make CAN forwarding work well on low bandwidth links. The filtering is applied on bits 8 to 24 of the CAN id (2nd and 3rd bytes) which corresponds to the DroneCAN message ID for DroneCAN. Filters with more than 16 IDs can be constructed by sending multiple CAN_FILTER_MODIFY messages."]
8211#[doc = ""]
8212#[doc = "ID: 388"]
8213#[derive(Debug, Clone, PartialEq)]
8214#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8215#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8216#[cfg_attr(feature = "ts", derive(TS))]
8217#[cfg_attr(feature = "ts", ts(export))]
8218pub struct CAN_FILTER_MODIFY_DATA {
8219 #[doc = "filter IDs, length num_ids"]
8220 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8221 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
8222 pub ids: [u16; 16],
8223 #[doc = "System ID."]
8224 pub target_system: u8,
8225 #[doc = "Component ID."]
8226 pub target_component: u8,
8227 #[doc = "bus number"]
8228 pub bus: u8,
8229 #[doc = "what operation to perform on the filter list. See CAN_FILTER_OP enum."]
8230 pub operation: CanFilterOp,
8231 #[doc = "number of IDs in filter list"]
8232 pub num_ids: u8,
8233}
8234impl CAN_FILTER_MODIFY_DATA {
8235 pub const ENCODED_LEN: usize = 37usize;
8236 pub const DEFAULT: Self = Self {
8237 ids: [0_u16; 16usize],
8238 target_system: 0_u8,
8239 target_component: 0_u8,
8240 bus: 0_u8,
8241 operation: CanFilterOp::DEFAULT,
8242 num_ids: 0_u8,
8243 };
8244 #[cfg(feature = "arbitrary")]
8245 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8246 use arbitrary::{Arbitrary, Unstructured};
8247 let mut buf = [0u8; 1024];
8248 rng.fill_bytes(&mut buf);
8249 let mut unstructured = Unstructured::new(&buf);
8250 Self::arbitrary(&mut unstructured).unwrap_or_default()
8251 }
8252}
8253impl Default for CAN_FILTER_MODIFY_DATA {
8254 fn default() -> Self {
8255 Self::DEFAULT.clone()
8256 }
8257}
8258impl MessageData for CAN_FILTER_MODIFY_DATA {
8259 type Message = MavMessage;
8260 const ID: u32 = 388u32;
8261 const NAME: &'static str = "CAN_FILTER_MODIFY";
8262 const EXTRA_CRC: u8 = 8u8;
8263 const ENCODED_LEN: usize = 37usize;
8264 fn deser(
8265 _version: MavlinkVersion,
8266 __input: &[u8],
8267 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8268 let avail_len = __input.len();
8269 let mut payload_buf = [0; Self::ENCODED_LEN];
8270 let mut buf = if avail_len < Self::ENCODED_LEN {
8271 payload_buf[0..avail_len].copy_from_slice(__input);
8272 Bytes::new(&payload_buf)
8273 } else {
8274 Bytes::new(__input)
8275 };
8276 let mut __struct = Self::default();
8277 for v in &mut __struct.ids {
8278 let val = buf.get_u16_le();
8279 *v = val;
8280 }
8281 __struct.target_system = buf.get_u8();
8282 __struct.target_component = buf.get_u8();
8283 __struct.bus = buf.get_u8();
8284 let tmp = buf.get_u8();
8285 __struct.operation =
8286 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8287 enum_type: "CanFilterOp",
8288 value: tmp as u64,
8289 })?;
8290 __struct.num_ids = buf.get_u8();
8291 Ok(__struct)
8292 }
8293 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8294 let mut __tmp = BytesMut::new(bytes);
8295 #[allow(clippy::absurd_extreme_comparisons)]
8296 #[allow(unused_comparisons)]
8297 if __tmp.remaining() < Self::ENCODED_LEN {
8298 panic!(
8299 "buffer is too small (need {} bytes, but got {})",
8300 Self::ENCODED_LEN,
8301 __tmp.remaining(),
8302 )
8303 }
8304 for val in &self.ids {
8305 __tmp.put_u16_le(*val);
8306 }
8307 __tmp.put_u8(self.target_system);
8308 __tmp.put_u8(self.target_component);
8309 __tmp.put_u8(self.bus);
8310 __tmp.put_u8(self.operation as u8);
8311 __tmp.put_u8(self.num_ids);
8312 if matches!(version, MavlinkVersion::V2) {
8313 let len = __tmp.len();
8314 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8315 } else {
8316 __tmp.len()
8317 }
8318 }
8319}
8320#[doc = "A forwarded CAN frame as requested by MAV_CMD_CAN_FORWARD."]
8321#[doc = ""]
8322#[doc = "ID: 386"]
8323#[derive(Debug, Clone, PartialEq)]
8324#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8325#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8326#[cfg_attr(feature = "ts", derive(TS))]
8327#[cfg_attr(feature = "ts", ts(export))]
8328pub struct CAN_FRAME_DATA {
8329 #[doc = "Frame ID"]
8330 pub id: u32,
8331 #[doc = "System ID."]
8332 pub target_system: u8,
8333 #[doc = "Component ID."]
8334 pub target_component: u8,
8335 #[doc = "Bus number"]
8336 pub bus: u8,
8337 #[doc = "Frame length"]
8338 pub len: u8,
8339 #[doc = "Frame data"]
8340 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8341 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
8342 pub data: [u8; 8],
8343}
8344impl CAN_FRAME_DATA {
8345 pub const ENCODED_LEN: usize = 16usize;
8346 pub const DEFAULT: Self = Self {
8347 id: 0_u32,
8348 target_system: 0_u8,
8349 target_component: 0_u8,
8350 bus: 0_u8,
8351 len: 0_u8,
8352 data: [0_u8; 8usize],
8353 };
8354 #[cfg(feature = "arbitrary")]
8355 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8356 use arbitrary::{Arbitrary, Unstructured};
8357 let mut buf = [0u8; 1024];
8358 rng.fill_bytes(&mut buf);
8359 let mut unstructured = Unstructured::new(&buf);
8360 Self::arbitrary(&mut unstructured).unwrap_or_default()
8361 }
8362}
8363impl Default for CAN_FRAME_DATA {
8364 fn default() -> Self {
8365 Self::DEFAULT.clone()
8366 }
8367}
8368impl MessageData for CAN_FRAME_DATA {
8369 type Message = MavMessage;
8370 const ID: u32 = 386u32;
8371 const NAME: &'static str = "CAN_FRAME";
8372 const EXTRA_CRC: u8 = 132u8;
8373 const ENCODED_LEN: usize = 16usize;
8374 fn deser(
8375 _version: MavlinkVersion,
8376 __input: &[u8],
8377 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8378 let avail_len = __input.len();
8379 let mut payload_buf = [0; Self::ENCODED_LEN];
8380 let mut buf = if avail_len < Self::ENCODED_LEN {
8381 payload_buf[0..avail_len].copy_from_slice(__input);
8382 Bytes::new(&payload_buf)
8383 } else {
8384 Bytes::new(__input)
8385 };
8386 let mut __struct = Self::default();
8387 __struct.id = buf.get_u32_le();
8388 __struct.target_system = buf.get_u8();
8389 __struct.target_component = buf.get_u8();
8390 __struct.bus = buf.get_u8();
8391 __struct.len = buf.get_u8();
8392 for v in &mut __struct.data {
8393 let val = buf.get_u8();
8394 *v = val;
8395 }
8396 Ok(__struct)
8397 }
8398 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8399 let mut __tmp = BytesMut::new(bytes);
8400 #[allow(clippy::absurd_extreme_comparisons)]
8401 #[allow(unused_comparisons)]
8402 if __tmp.remaining() < Self::ENCODED_LEN {
8403 panic!(
8404 "buffer is too small (need {} bytes, but got {})",
8405 Self::ENCODED_LEN,
8406 __tmp.remaining(),
8407 )
8408 }
8409 __tmp.put_u32_le(self.id);
8410 __tmp.put_u8(self.target_system);
8411 __tmp.put_u8(self.target_component);
8412 __tmp.put_u8(self.bus);
8413 __tmp.put_u8(self.len);
8414 for val in &self.data {
8415 __tmp.put_u8(*val);
8416 }
8417 if matches!(version, MavlinkVersion::V2) {
8418 let len = __tmp.len();
8419 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8420 } else {
8421 __tmp.len()
8422 }
8423 }
8424}
8425#[doc = "Configure cellular modems. This message is re-emitted as an acknowledgement by the modem. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
8426#[doc = ""]
8427#[doc = "ID: 336"]
8428#[derive(Debug, Clone, PartialEq)]
8429#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8430#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8431#[cfg_attr(feature = "ts", derive(TS))]
8432#[cfg_attr(feature = "ts", ts(export))]
8433pub struct CELLULAR_CONFIG_DATA {
8434 #[doc = "Enable/disable LTE. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
8435 pub enable_lte: u8,
8436 #[doc = "Enable/disable PIN on the SIM card. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
8437 pub enable_pin: u8,
8438 #[doc = "PIN sent to the SIM card. Blank when PIN is disabled. Empty when message is sent back as a response."]
8439 #[cfg_attr(feature = "ts", ts(type = "string"))]
8440 pub pin: CharArray<16>,
8441 #[doc = "New PIN when changing the PIN. Blank to leave it unchanged. Empty when message is sent back as a response."]
8442 #[cfg_attr(feature = "ts", ts(type = "string"))]
8443 pub new_pin: CharArray<16>,
8444 #[doc = "Name of the cellular APN. Blank to leave it unchanged. Current APN when sent back as a response."]
8445 #[cfg_attr(feature = "ts", ts(type = "string"))]
8446 pub apn: CharArray<32>,
8447 #[doc = "Required PUK code in case the user failed to authenticate 3 times with the PIN. Empty when message is sent back as a response."]
8448 #[cfg_attr(feature = "ts", ts(type = "string"))]
8449 pub puk: CharArray<16>,
8450 #[doc = "Enable/disable roaming. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
8451 pub roaming: u8,
8452 #[doc = "Message acceptance response (sent back to GS)."]
8453 pub response: CellularConfigResponse,
8454}
8455impl CELLULAR_CONFIG_DATA {
8456 pub const ENCODED_LEN: usize = 84usize;
8457 pub const DEFAULT: Self = Self {
8458 enable_lte: 0_u8,
8459 enable_pin: 0_u8,
8460 pin: CharArray::new([0_u8; 16usize]),
8461 new_pin: CharArray::new([0_u8; 16usize]),
8462 apn: CharArray::new([0_u8; 32usize]),
8463 puk: CharArray::new([0_u8; 16usize]),
8464 roaming: 0_u8,
8465 response: CellularConfigResponse::DEFAULT,
8466 };
8467 #[cfg(feature = "arbitrary")]
8468 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8469 use arbitrary::{Arbitrary, Unstructured};
8470 let mut buf = [0u8; 1024];
8471 rng.fill_bytes(&mut buf);
8472 let mut unstructured = Unstructured::new(&buf);
8473 Self::arbitrary(&mut unstructured).unwrap_or_default()
8474 }
8475}
8476impl Default for CELLULAR_CONFIG_DATA {
8477 fn default() -> Self {
8478 Self::DEFAULT.clone()
8479 }
8480}
8481impl MessageData for CELLULAR_CONFIG_DATA {
8482 type Message = MavMessage;
8483 const ID: u32 = 336u32;
8484 const NAME: &'static str = "CELLULAR_CONFIG";
8485 const EXTRA_CRC: u8 = 245u8;
8486 const ENCODED_LEN: usize = 84usize;
8487 fn deser(
8488 _version: MavlinkVersion,
8489 __input: &[u8],
8490 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8491 let avail_len = __input.len();
8492 let mut payload_buf = [0; Self::ENCODED_LEN];
8493 let mut buf = if avail_len < Self::ENCODED_LEN {
8494 payload_buf[0..avail_len].copy_from_slice(__input);
8495 Bytes::new(&payload_buf)
8496 } else {
8497 Bytes::new(__input)
8498 };
8499 let mut __struct = Self::default();
8500 __struct.enable_lte = buf.get_u8();
8501 __struct.enable_pin = buf.get_u8();
8502 let mut tmp = [0_u8; 16usize];
8503 for v in &mut tmp {
8504 *v = buf.get_u8();
8505 }
8506 __struct.pin = CharArray::new(tmp);
8507 let mut tmp = [0_u8; 16usize];
8508 for v in &mut tmp {
8509 *v = buf.get_u8();
8510 }
8511 __struct.new_pin = CharArray::new(tmp);
8512 let mut tmp = [0_u8; 32usize];
8513 for v in &mut tmp {
8514 *v = buf.get_u8();
8515 }
8516 __struct.apn = CharArray::new(tmp);
8517 let mut tmp = [0_u8; 16usize];
8518 for v in &mut tmp {
8519 *v = buf.get_u8();
8520 }
8521 __struct.puk = CharArray::new(tmp);
8522 __struct.roaming = buf.get_u8();
8523 let tmp = buf.get_u8();
8524 __struct.response =
8525 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8526 enum_type: "CellularConfigResponse",
8527 value: tmp as u64,
8528 })?;
8529 Ok(__struct)
8530 }
8531 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8532 let mut __tmp = BytesMut::new(bytes);
8533 #[allow(clippy::absurd_extreme_comparisons)]
8534 #[allow(unused_comparisons)]
8535 if __tmp.remaining() < Self::ENCODED_LEN {
8536 panic!(
8537 "buffer is too small (need {} bytes, but got {})",
8538 Self::ENCODED_LEN,
8539 __tmp.remaining(),
8540 )
8541 }
8542 __tmp.put_u8(self.enable_lte);
8543 __tmp.put_u8(self.enable_pin);
8544 for val in &self.pin {
8545 __tmp.put_u8(*val);
8546 }
8547 for val in &self.new_pin {
8548 __tmp.put_u8(*val);
8549 }
8550 for val in &self.apn {
8551 __tmp.put_u8(*val);
8552 }
8553 for val in &self.puk {
8554 __tmp.put_u8(*val);
8555 }
8556 __tmp.put_u8(self.roaming);
8557 __tmp.put_u8(self.response as u8);
8558 if matches!(version, MavlinkVersion::V2) {
8559 let len = __tmp.len();
8560 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8561 } else {
8562 __tmp.len()
8563 }
8564 }
8565}
8566#[doc = "Report current used cellular network status."]
8567#[doc = ""]
8568#[doc = "ID: 334"]
8569#[derive(Debug, Clone, PartialEq)]
8570#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8571#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8572#[cfg_attr(feature = "ts", derive(TS))]
8573#[cfg_attr(feature = "ts", ts(export))]
8574pub struct CELLULAR_STATUS_DATA {
8575 #[doc = "Mobile country code. If unknown, set to UINT16_MAX"]
8576 pub mcc: u16,
8577 #[doc = "Mobile network code. If unknown, set to UINT16_MAX"]
8578 pub mnc: u16,
8579 #[doc = "Location area code. If unknown, set to 0"]
8580 pub lac: u16,
8581 #[doc = "Cellular modem status"]
8582 pub status: CellularStatusFlag,
8583 #[doc = "Failure reason when status in in CELLULAR_STATUS_FLAG_FAILED"]
8584 pub failure_reason: CellularNetworkFailedReason,
8585 #[doc = "Cellular network radio type: gsm, cdma, lte..."]
8586 pub mavtype: CellularNetworkRadioType,
8587 #[doc = "Signal quality in percent. If unknown, set to UINT8_MAX"]
8588 pub quality: u8,
8589}
8590impl CELLULAR_STATUS_DATA {
8591 pub const ENCODED_LEN: usize = 10usize;
8592 pub const DEFAULT: Self = Self {
8593 mcc: 0_u16,
8594 mnc: 0_u16,
8595 lac: 0_u16,
8596 status: CellularStatusFlag::DEFAULT,
8597 failure_reason: CellularNetworkFailedReason::DEFAULT,
8598 mavtype: CellularNetworkRadioType::DEFAULT,
8599 quality: 0_u8,
8600 };
8601 #[cfg(feature = "arbitrary")]
8602 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8603 use arbitrary::{Arbitrary, Unstructured};
8604 let mut buf = [0u8; 1024];
8605 rng.fill_bytes(&mut buf);
8606 let mut unstructured = Unstructured::new(&buf);
8607 Self::arbitrary(&mut unstructured).unwrap_or_default()
8608 }
8609}
8610impl Default for CELLULAR_STATUS_DATA {
8611 fn default() -> Self {
8612 Self::DEFAULT.clone()
8613 }
8614}
8615impl MessageData for CELLULAR_STATUS_DATA {
8616 type Message = MavMessage;
8617 const ID: u32 = 334u32;
8618 const NAME: &'static str = "CELLULAR_STATUS";
8619 const EXTRA_CRC: u8 = 72u8;
8620 const ENCODED_LEN: usize = 10usize;
8621 fn deser(
8622 _version: MavlinkVersion,
8623 __input: &[u8],
8624 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8625 let avail_len = __input.len();
8626 let mut payload_buf = [0; Self::ENCODED_LEN];
8627 let mut buf = if avail_len < Self::ENCODED_LEN {
8628 payload_buf[0..avail_len].copy_from_slice(__input);
8629 Bytes::new(&payload_buf)
8630 } else {
8631 Bytes::new(__input)
8632 };
8633 let mut __struct = Self::default();
8634 __struct.mcc = buf.get_u16_le();
8635 __struct.mnc = buf.get_u16_le();
8636 __struct.lac = buf.get_u16_le();
8637 let tmp = buf.get_u8();
8638 __struct.status =
8639 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8640 enum_type: "CellularStatusFlag",
8641 value: tmp as u64,
8642 })?;
8643 let tmp = buf.get_u8();
8644 __struct.failure_reason =
8645 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8646 enum_type: "CellularNetworkFailedReason",
8647 value: tmp as u64,
8648 })?;
8649 let tmp = buf.get_u8();
8650 __struct.mavtype =
8651 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8652 enum_type: "CellularNetworkRadioType",
8653 value: tmp as u64,
8654 })?;
8655 __struct.quality = buf.get_u8();
8656 Ok(__struct)
8657 }
8658 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8659 let mut __tmp = BytesMut::new(bytes);
8660 #[allow(clippy::absurd_extreme_comparisons)]
8661 #[allow(unused_comparisons)]
8662 if __tmp.remaining() < Self::ENCODED_LEN {
8663 panic!(
8664 "buffer is too small (need {} bytes, but got {})",
8665 Self::ENCODED_LEN,
8666 __tmp.remaining(),
8667 )
8668 }
8669 __tmp.put_u16_le(self.mcc);
8670 __tmp.put_u16_le(self.mnc);
8671 __tmp.put_u16_le(self.lac);
8672 __tmp.put_u8(self.status as u8);
8673 __tmp.put_u8(self.failure_reason as u8);
8674 __tmp.put_u8(self.mavtype as u8);
8675 __tmp.put_u8(self.quality);
8676 if matches!(version, MavlinkVersion::V2) {
8677 let len = __tmp.len();
8678 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8679 } else {
8680 __tmp.len()
8681 }
8682 }
8683}
8684#[doc = "Request to control this MAV."]
8685#[doc = ""]
8686#[doc = "ID: 5"]
8687#[derive(Debug, Clone, PartialEq)]
8688#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8689#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8690#[cfg_attr(feature = "ts", derive(TS))]
8691#[cfg_attr(feature = "ts", ts(export))]
8692pub struct CHANGE_OPERATOR_CONTROL_DATA {
8693 #[doc = "System the GCS requests control for"]
8694 pub target_system: u8,
8695 #[doc = "0: request control of this MAV, 1: Release control of this MAV"]
8696 pub control_request: u8,
8697 #[doc = "0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch."]
8698 pub version: u8,
8699 #[doc = "Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and \"!?,.-\""]
8700 #[cfg_attr(feature = "ts", ts(type = "string"))]
8701 pub passkey: CharArray<25>,
8702}
8703impl CHANGE_OPERATOR_CONTROL_DATA {
8704 pub const ENCODED_LEN: usize = 28usize;
8705 pub const DEFAULT: Self = Self {
8706 target_system: 0_u8,
8707 control_request: 0_u8,
8708 version: 0_u8,
8709 passkey: CharArray::new([0_u8; 25usize]),
8710 };
8711 #[cfg(feature = "arbitrary")]
8712 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8713 use arbitrary::{Arbitrary, Unstructured};
8714 let mut buf = [0u8; 1024];
8715 rng.fill_bytes(&mut buf);
8716 let mut unstructured = Unstructured::new(&buf);
8717 Self::arbitrary(&mut unstructured).unwrap_or_default()
8718 }
8719}
8720impl Default for CHANGE_OPERATOR_CONTROL_DATA {
8721 fn default() -> Self {
8722 Self::DEFAULT.clone()
8723 }
8724}
8725impl MessageData for CHANGE_OPERATOR_CONTROL_DATA {
8726 type Message = MavMessage;
8727 const ID: u32 = 5u32;
8728 const NAME: &'static str = "CHANGE_OPERATOR_CONTROL";
8729 const EXTRA_CRC: u8 = 217u8;
8730 const ENCODED_LEN: usize = 28usize;
8731 fn deser(
8732 _version: MavlinkVersion,
8733 __input: &[u8],
8734 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8735 let avail_len = __input.len();
8736 let mut payload_buf = [0; Self::ENCODED_LEN];
8737 let mut buf = if avail_len < Self::ENCODED_LEN {
8738 payload_buf[0..avail_len].copy_from_slice(__input);
8739 Bytes::new(&payload_buf)
8740 } else {
8741 Bytes::new(__input)
8742 };
8743 let mut __struct = Self::default();
8744 __struct.target_system = buf.get_u8();
8745 __struct.control_request = buf.get_u8();
8746 __struct.version = buf.get_u8();
8747 let mut tmp = [0_u8; 25usize];
8748 for v in &mut tmp {
8749 *v = buf.get_u8();
8750 }
8751 __struct.passkey = CharArray::new(tmp);
8752 Ok(__struct)
8753 }
8754 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8755 let mut __tmp = BytesMut::new(bytes);
8756 #[allow(clippy::absurd_extreme_comparisons)]
8757 #[allow(unused_comparisons)]
8758 if __tmp.remaining() < Self::ENCODED_LEN {
8759 panic!(
8760 "buffer is too small (need {} bytes, but got {})",
8761 Self::ENCODED_LEN,
8762 __tmp.remaining(),
8763 )
8764 }
8765 __tmp.put_u8(self.target_system);
8766 __tmp.put_u8(self.control_request);
8767 __tmp.put_u8(self.version);
8768 for val in &self.passkey {
8769 __tmp.put_u8(*val);
8770 }
8771 if matches!(version, MavlinkVersion::V2) {
8772 let len = __tmp.len();
8773 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8774 } else {
8775 __tmp.len()
8776 }
8777 }
8778}
8779#[doc = "Accept / deny control of this MAV."]
8780#[doc = ""]
8781#[doc = "ID: 6"]
8782#[derive(Debug, Clone, PartialEq)]
8783#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8784#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8785#[cfg_attr(feature = "ts", derive(TS))]
8786#[cfg_attr(feature = "ts", ts(export))]
8787pub struct CHANGE_OPERATOR_CONTROL_ACK_DATA {
8788 #[doc = "ID of the GCS this message"]
8789 pub gcs_system_id: u8,
8790 #[doc = "0: request control of this MAV, 1: Release control of this MAV"]
8791 pub control_request: u8,
8792 #[doc = "0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control"]
8793 pub ack: u8,
8794}
8795impl CHANGE_OPERATOR_CONTROL_ACK_DATA {
8796 pub const ENCODED_LEN: usize = 3usize;
8797 pub const DEFAULT: Self = Self {
8798 gcs_system_id: 0_u8,
8799 control_request: 0_u8,
8800 ack: 0_u8,
8801 };
8802 #[cfg(feature = "arbitrary")]
8803 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8804 use arbitrary::{Arbitrary, Unstructured};
8805 let mut buf = [0u8; 1024];
8806 rng.fill_bytes(&mut buf);
8807 let mut unstructured = Unstructured::new(&buf);
8808 Self::arbitrary(&mut unstructured).unwrap_or_default()
8809 }
8810}
8811impl Default for CHANGE_OPERATOR_CONTROL_ACK_DATA {
8812 fn default() -> Self {
8813 Self::DEFAULT.clone()
8814 }
8815}
8816impl MessageData for CHANGE_OPERATOR_CONTROL_ACK_DATA {
8817 type Message = MavMessage;
8818 const ID: u32 = 6u32;
8819 const NAME: &'static str = "CHANGE_OPERATOR_CONTROL_ACK";
8820 const EXTRA_CRC: u8 = 104u8;
8821 const ENCODED_LEN: usize = 3usize;
8822 fn deser(
8823 _version: MavlinkVersion,
8824 __input: &[u8],
8825 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8826 let avail_len = __input.len();
8827 let mut payload_buf = [0; Self::ENCODED_LEN];
8828 let mut buf = if avail_len < Self::ENCODED_LEN {
8829 payload_buf[0..avail_len].copy_from_slice(__input);
8830 Bytes::new(&payload_buf)
8831 } else {
8832 Bytes::new(__input)
8833 };
8834 let mut __struct = Self::default();
8835 __struct.gcs_system_id = buf.get_u8();
8836 __struct.control_request = buf.get_u8();
8837 __struct.ack = buf.get_u8();
8838 Ok(__struct)
8839 }
8840 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8841 let mut __tmp = BytesMut::new(bytes);
8842 #[allow(clippy::absurd_extreme_comparisons)]
8843 #[allow(unused_comparisons)]
8844 if __tmp.remaining() < Self::ENCODED_LEN {
8845 panic!(
8846 "buffer is too small (need {} bytes, but got {})",
8847 Self::ENCODED_LEN,
8848 __tmp.remaining(),
8849 )
8850 }
8851 __tmp.put_u8(self.gcs_system_id);
8852 __tmp.put_u8(self.control_request);
8853 __tmp.put_u8(self.ack);
8854 if matches!(version, MavlinkVersion::V2) {
8855 let len = __tmp.len();
8856 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8857 } else {
8858 __tmp.len()
8859 }
8860 }
8861}
8862#[doc = "Information about a potential collision."]
8863#[doc = ""]
8864#[doc = "ID: 247"]
8865#[derive(Debug, Clone, PartialEq)]
8866#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8867#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8868#[cfg_attr(feature = "ts", derive(TS))]
8869#[cfg_attr(feature = "ts", ts(export))]
8870pub struct COLLISION_DATA {
8871 #[doc = "Unique identifier, domain based on src field"]
8872 pub id: u32,
8873 #[doc = "Estimated time until collision occurs"]
8874 pub time_to_minimum_delta: f32,
8875 #[doc = "Closest vertical distance between vehicle and object"]
8876 pub altitude_minimum_delta: f32,
8877 #[doc = "Closest horizontal distance between vehicle and object"]
8878 pub horizontal_minimum_delta: f32,
8879 #[doc = "Collision data source"]
8880 pub src: MavCollisionSrc,
8881 #[doc = "Action that is being taken to avoid this collision"]
8882 pub action: MavCollisionAction,
8883 #[doc = "How concerned the aircraft is about this collision"]
8884 pub threat_level: MavCollisionThreatLevel,
8885}
8886impl COLLISION_DATA {
8887 pub const ENCODED_LEN: usize = 19usize;
8888 pub const DEFAULT: Self = Self {
8889 id: 0_u32,
8890 time_to_minimum_delta: 0.0_f32,
8891 altitude_minimum_delta: 0.0_f32,
8892 horizontal_minimum_delta: 0.0_f32,
8893 src: MavCollisionSrc::DEFAULT,
8894 action: MavCollisionAction::DEFAULT,
8895 threat_level: MavCollisionThreatLevel::DEFAULT,
8896 };
8897 #[cfg(feature = "arbitrary")]
8898 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8899 use arbitrary::{Arbitrary, Unstructured};
8900 let mut buf = [0u8; 1024];
8901 rng.fill_bytes(&mut buf);
8902 let mut unstructured = Unstructured::new(&buf);
8903 Self::arbitrary(&mut unstructured).unwrap_or_default()
8904 }
8905}
8906impl Default for COLLISION_DATA {
8907 fn default() -> Self {
8908 Self::DEFAULT.clone()
8909 }
8910}
8911impl MessageData for COLLISION_DATA {
8912 type Message = MavMessage;
8913 const ID: u32 = 247u32;
8914 const NAME: &'static str = "COLLISION";
8915 const EXTRA_CRC: u8 = 81u8;
8916 const ENCODED_LEN: usize = 19usize;
8917 fn deser(
8918 _version: MavlinkVersion,
8919 __input: &[u8],
8920 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8921 let avail_len = __input.len();
8922 let mut payload_buf = [0; Self::ENCODED_LEN];
8923 let mut buf = if avail_len < Self::ENCODED_LEN {
8924 payload_buf[0..avail_len].copy_from_slice(__input);
8925 Bytes::new(&payload_buf)
8926 } else {
8927 Bytes::new(__input)
8928 };
8929 let mut __struct = Self::default();
8930 __struct.id = buf.get_u32_le();
8931 __struct.time_to_minimum_delta = buf.get_f32_le();
8932 __struct.altitude_minimum_delta = buf.get_f32_le();
8933 __struct.horizontal_minimum_delta = buf.get_f32_le();
8934 let tmp = buf.get_u8();
8935 __struct.src =
8936 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8937 enum_type: "MavCollisionSrc",
8938 value: tmp as u64,
8939 })?;
8940 let tmp = buf.get_u8();
8941 __struct.action =
8942 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8943 enum_type: "MavCollisionAction",
8944 value: tmp as u64,
8945 })?;
8946 let tmp = buf.get_u8();
8947 __struct.threat_level =
8948 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8949 enum_type: "MavCollisionThreatLevel",
8950 value: tmp as u64,
8951 })?;
8952 Ok(__struct)
8953 }
8954 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8955 let mut __tmp = BytesMut::new(bytes);
8956 #[allow(clippy::absurd_extreme_comparisons)]
8957 #[allow(unused_comparisons)]
8958 if __tmp.remaining() < Self::ENCODED_LEN {
8959 panic!(
8960 "buffer is too small (need {} bytes, but got {})",
8961 Self::ENCODED_LEN,
8962 __tmp.remaining(),
8963 )
8964 }
8965 __tmp.put_u32_le(self.id);
8966 __tmp.put_f32_le(self.time_to_minimum_delta);
8967 __tmp.put_f32_le(self.altitude_minimum_delta);
8968 __tmp.put_f32_le(self.horizontal_minimum_delta);
8969 __tmp.put_u8(self.src as u8);
8970 __tmp.put_u8(self.action as u8);
8971 __tmp.put_u8(self.threat_level as u8);
8972 if matches!(version, MavlinkVersion::V2) {
8973 let len = __tmp.len();
8974 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8975 } else {
8976 __tmp.len()
8977 }
8978 }
8979}
8980#[doc = "Report status of a command. Includes feedback whether the command was executed. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
8981#[doc = ""]
8982#[doc = "ID: 77"]
8983#[derive(Debug, Clone, PartialEq)]
8984#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8985#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8986#[cfg_attr(feature = "ts", derive(TS))]
8987#[cfg_attr(feature = "ts", ts(export))]
8988pub struct COMMAND_ACK_DATA {
8989 #[doc = "Command ID (of acknowledged command)."]
8990 pub command: MavCmd,
8991 #[doc = "Result of command."]
8992 pub result: MavResult,
8993 #[doc = "The progress percentage when result is MAV_RESULT_IN_PROGRESS. Values: [0-100], or UINT8_MAX if the progress is unknown."]
8994 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8995 pub progress: u8,
8996 #[doc = "Additional result information. Can be set with a command-specific enum containing command-specific error reasons for why the command might be denied. If used, the associated enum must be documented in the corresponding MAV_CMD (this enum should have a 0 value to indicate \"unused\" or \"unknown\")."]
8997 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8998 pub result_param2: i32,
8999 #[doc = "System ID of the target recipient. This is the ID of the system that sent the command for which this COMMAND_ACK is an acknowledgement."]
9000 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9001 pub target_system: u8,
9002 #[doc = "Component ID of the target recipient. This is the ID of the system that sent the command for which this COMMAND_ACK is an acknowledgement."]
9003 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9004 pub target_component: u8,
9005}
9006impl COMMAND_ACK_DATA {
9007 pub const ENCODED_LEN: usize = 10usize;
9008 pub const DEFAULT: Self = Self {
9009 command: MavCmd::DEFAULT,
9010 result: MavResult::DEFAULT,
9011 progress: 0_u8,
9012 result_param2: 0_i32,
9013 target_system: 0_u8,
9014 target_component: 0_u8,
9015 };
9016 #[cfg(feature = "arbitrary")]
9017 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9018 use arbitrary::{Arbitrary, Unstructured};
9019 let mut buf = [0u8; 1024];
9020 rng.fill_bytes(&mut buf);
9021 let mut unstructured = Unstructured::new(&buf);
9022 Self::arbitrary(&mut unstructured).unwrap_or_default()
9023 }
9024}
9025impl Default for COMMAND_ACK_DATA {
9026 fn default() -> Self {
9027 Self::DEFAULT.clone()
9028 }
9029}
9030impl MessageData for COMMAND_ACK_DATA {
9031 type Message = MavMessage;
9032 const ID: u32 = 77u32;
9033 const NAME: &'static str = "COMMAND_ACK";
9034 const EXTRA_CRC: u8 = 143u8;
9035 const ENCODED_LEN: usize = 10usize;
9036 fn deser(
9037 _version: MavlinkVersion,
9038 __input: &[u8],
9039 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9040 let avail_len = __input.len();
9041 let mut payload_buf = [0; Self::ENCODED_LEN];
9042 let mut buf = if avail_len < Self::ENCODED_LEN {
9043 payload_buf[0..avail_len].copy_from_slice(__input);
9044 Bytes::new(&payload_buf)
9045 } else {
9046 Bytes::new(__input)
9047 };
9048 let mut __struct = Self::default();
9049 let tmp = buf.get_u16_le();
9050 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
9051 ::mavlink_core::error::ParserError::InvalidEnum {
9052 enum_type: "MavCmd",
9053 value: tmp as u64,
9054 },
9055 )?;
9056 let tmp = buf.get_u8();
9057 __struct.result =
9058 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9059 enum_type: "MavResult",
9060 value: tmp as u64,
9061 })?;
9062 __struct.progress = buf.get_u8();
9063 __struct.result_param2 = buf.get_i32_le();
9064 __struct.target_system = buf.get_u8();
9065 __struct.target_component = buf.get_u8();
9066 Ok(__struct)
9067 }
9068 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9069 let mut __tmp = BytesMut::new(bytes);
9070 #[allow(clippy::absurd_extreme_comparisons)]
9071 #[allow(unused_comparisons)]
9072 if __tmp.remaining() < Self::ENCODED_LEN {
9073 panic!(
9074 "buffer is too small (need {} bytes, but got {})",
9075 Self::ENCODED_LEN,
9076 __tmp.remaining(),
9077 )
9078 }
9079 __tmp.put_u16_le(self.command as u16);
9080 __tmp.put_u8(self.result as u8);
9081 if matches!(version, MavlinkVersion::V2) {
9082 __tmp.put_u8(self.progress);
9083 __tmp.put_i32_le(self.result_param2);
9084 __tmp.put_u8(self.target_system);
9085 __tmp.put_u8(self.target_component);
9086 let len = __tmp.len();
9087 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9088 } else {
9089 __tmp.len()
9090 }
9091 }
9092}
9093#[doc = "Cancel a long running command. The target system should respond with a COMMAND_ACK to the original command with result=MAV_RESULT_CANCELLED if the long running process was cancelled. If it has already completed, the cancel action can be ignored. The cancel action can be retried until some sort of acknowledgement to the original command has been received. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
9094#[doc = ""]
9095#[doc = "ID: 80"]
9096#[derive(Debug, Clone, PartialEq)]
9097#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9098#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9099#[cfg_attr(feature = "ts", derive(TS))]
9100#[cfg_attr(feature = "ts", ts(export))]
9101pub struct COMMAND_CANCEL_DATA {
9102 #[doc = "Command ID (of command to cancel)."]
9103 pub command: MavCmd,
9104 #[doc = "System executing long running command. Should not be broadcast (0)."]
9105 pub target_system: u8,
9106 #[doc = "Component executing long running command."]
9107 pub target_component: u8,
9108}
9109impl COMMAND_CANCEL_DATA {
9110 pub const ENCODED_LEN: usize = 4usize;
9111 pub const DEFAULT: Self = Self {
9112 command: MavCmd::DEFAULT,
9113 target_system: 0_u8,
9114 target_component: 0_u8,
9115 };
9116 #[cfg(feature = "arbitrary")]
9117 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9118 use arbitrary::{Arbitrary, Unstructured};
9119 let mut buf = [0u8; 1024];
9120 rng.fill_bytes(&mut buf);
9121 let mut unstructured = Unstructured::new(&buf);
9122 Self::arbitrary(&mut unstructured).unwrap_or_default()
9123 }
9124}
9125impl Default for COMMAND_CANCEL_DATA {
9126 fn default() -> Self {
9127 Self::DEFAULT.clone()
9128 }
9129}
9130impl MessageData for COMMAND_CANCEL_DATA {
9131 type Message = MavMessage;
9132 const ID: u32 = 80u32;
9133 const NAME: &'static str = "COMMAND_CANCEL";
9134 const EXTRA_CRC: u8 = 14u8;
9135 const ENCODED_LEN: usize = 4usize;
9136 fn deser(
9137 _version: MavlinkVersion,
9138 __input: &[u8],
9139 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9140 let avail_len = __input.len();
9141 let mut payload_buf = [0; Self::ENCODED_LEN];
9142 let mut buf = if avail_len < Self::ENCODED_LEN {
9143 payload_buf[0..avail_len].copy_from_slice(__input);
9144 Bytes::new(&payload_buf)
9145 } else {
9146 Bytes::new(__input)
9147 };
9148 let mut __struct = Self::default();
9149 let tmp = buf.get_u16_le();
9150 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
9151 ::mavlink_core::error::ParserError::InvalidEnum {
9152 enum_type: "MavCmd",
9153 value: tmp as u64,
9154 },
9155 )?;
9156 __struct.target_system = buf.get_u8();
9157 __struct.target_component = buf.get_u8();
9158 Ok(__struct)
9159 }
9160 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9161 let mut __tmp = BytesMut::new(bytes);
9162 #[allow(clippy::absurd_extreme_comparisons)]
9163 #[allow(unused_comparisons)]
9164 if __tmp.remaining() < Self::ENCODED_LEN {
9165 panic!(
9166 "buffer is too small (need {} bytes, but got {})",
9167 Self::ENCODED_LEN,
9168 __tmp.remaining(),
9169 )
9170 }
9171 __tmp.put_u16_le(self.command as u16);
9172 __tmp.put_u8(self.target_system);
9173 __tmp.put_u8(self.target_component);
9174 if matches!(version, MavlinkVersion::V2) {
9175 let len = __tmp.len();
9176 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9177 } else {
9178 __tmp.len()
9179 }
9180 }
9181}
9182#[doc = "Send a command with up to seven parameters to the MAV, where params 5 and 6 are integers and the other values are floats. This is preferred over COMMAND_LONG as it allows the MAV_FRAME to be specified for interpreting positional information, such as altitude. COMMAND_INT is also preferred when sending latitude and longitude data in params 5 and 6, as it allows for greater precision. Param 5 and 6 encode positional data as scaled integers, where the scaling depends on the actual command value. NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
9183#[doc = ""]
9184#[doc = "ID: 75"]
9185#[derive(Debug, Clone, PartialEq)]
9186#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9187#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9188#[cfg_attr(feature = "ts", derive(TS))]
9189#[cfg_attr(feature = "ts", ts(export))]
9190pub struct COMMAND_INT_DATA {
9191 #[doc = "PARAM1, see MAV_CMD enum"]
9192 pub param1: f32,
9193 #[doc = "PARAM2, see MAV_CMD enum"]
9194 pub param2: f32,
9195 #[doc = "PARAM3, see MAV_CMD enum"]
9196 pub param3: f32,
9197 #[doc = "PARAM4, see MAV_CMD enum"]
9198 pub param4: f32,
9199 #[doc = "PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7"]
9200 pub x: i32,
9201 #[doc = "PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7"]
9202 pub y: i32,
9203 #[doc = "PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame)."]
9204 pub z: f32,
9205 #[doc = "The scheduled action for the mission item."]
9206 pub command: MavCmd,
9207 #[doc = "System ID"]
9208 pub target_system: u8,
9209 #[doc = "Component ID"]
9210 pub target_component: u8,
9211 #[doc = "The coordinate system of the COMMAND."]
9212 pub frame: MavFrame,
9213 #[doc = "Not used."]
9214 pub current: u8,
9215 #[doc = "Not used (set 0)."]
9216 pub autocontinue: u8,
9217}
9218impl COMMAND_INT_DATA {
9219 pub const ENCODED_LEN: usize = 35usize;
9220 pub const DEFAULT: Self = Self {
9221 param1: 0.0_f32,
9222 param2: 0.0_f32,
9223 param3: 0.0_f32,
9224 param4: 0.0_f32,
9225 x: 0_i32,
9226 y: 0_i32,
9227 z: 0.0_f32,
9228 command: MavCmd::DEFAULT,
9229 target_system: 0_u8,
9230 target_component: 0_u8,
9231 frame: MavFrame::DEFAULT,
9232 current: 0_u8,
9233 autocontinue: 0_u8,
9234 };
9235 #[cfg(feature = "arbitrary")]
9236 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9237 use arbitrary::{Arbitrary, Unstructured};
9238 let mut buf = [0u8; 1024];
9239 rng.fill_bytes(&mut buf);
9240 let mut unstructured = Unstructured::new(&buf);
9241 Self::arbitrary(&mut unstructured).unwrap_or_default()
9242 }
9243}
9244impl Default for COMMAND_INT_DATA {
9245 fn default() -> Self {
9246 Self::DEFAULT.clone()
9247 }
9248}
9249impl MessageData for COMMAND_INT_DATA {
9250 type Message = MavMessage;
9251 const ID: u32 = 75u32;
9252 const NAME: &'static str = "COMMAND_INT";
9253 const EXTRA_CRC: u8 = 158u8;
9254 const ENCODED_LEN: usize = 35usize;
9255 fn deser(
9256 _version: MavlinkVersion,
9257 __input: &[u8],
9258 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9259 let avail_len = __input.len();
9260 let mut payload_buf = [0; Self::ENCODED_LEN];
9261 let mut buf = if avail_len < Self::ENCODED_LEN {
9262 payload_buf[0..avail_len].copy_from_slice(__input);
9263 Bytes::new(&payload_buf)
9264 } else {
9265 Bytes::new(__input)
9266 };
9267 let mut __struct = Self::default();
9268 __struct.param1 = buf.get_f32_le();
9269 __struct.param2 = buf.get_f32_le();
9270 __struct.param3 = buf.get_f32_le();
9271 __struct.param4 = buf.get_f32_le();
9272 __struct.x = buf.get_i32_le();
9273 __struct.y = buf.get_i32_le();
9274 __struct.z = buf.get_f32_le();
9275 let tmp = buf.get_u16_le();
9276 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
9277 ::mavlink_core::error::ParserError::InvalidEnum {
9278 enum_type: "MavCmd",
9279 value: tmp as u64,
9280 },
9281 )?;
9282 __struct.target_system = buf.get_u8();
9283 __struct.target_component = buf.get_u8();
9284 let tmp = buf.get_u8();
9285 __struct.frame =
9286 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9287 enum_type: "MavFrame",
9288 value: tmp as u64,
9289 })?;
9290 __struct.current = buf.get_u8();
9291 __struct.autocontinue = buf.get_u8();
9292 Ok(__struct)
9293 }
9294 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9295 let mut __tmp = BytesMut::new(bytes);
9296 #[allow(clippy::absurd_extreme_comparisons)]
9297 #[allow(unused_comparisons)]
9298 if __tmp.remaining() < Self::ENCODED_LEN {
9299 panic!(
9300 "buffer is too small (need {} bytes, but got {})",
9301 Self::ENCODED_LEN,
9302 __tmp.remaining(),
9303 )
9304 }
9305 __tmp.put_f32_le(self.param1);
9306 __tmp.put_f32_le(self.param2);
9307 __tmp.put_f32_le(self.param3);
9308 __tmp.put_f32_le(self.param4);
9309 __tmp.put_i32_le(self.x);
9310 __tmp.put_i32_le(self.y);
9311 __tmp.put_f32_le(self.z);
9312 __tmp.put_u16_le(self.command as u16);
9313 __tmp.put_u8(self.target_system);
9314 __tmp.put_u8(self.target_component);
9315 __tmp.put_u8(self.frame as u8);
9316 __tmp.put_u8(self.current);
9317 __tmp.put_u8(self.autocontinue);
9318 if matches!(version, MavlinkVersion::V2) {
9319 let len = __tmp.len();
9320 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9321 } else {
9322 __tmp.len()
9323 }
9324 }
9325}
9326#[doc = "Send a command with up to seven parameters to the MAV. COMMAND_INT is generally preferred when sending MAV_CMD commands that include positional information; it offers higher precision and allows the MAV_FRAME to be specified (which may otherwise be ambiguous, particularly for altitude). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
9327#[doc = ""]
9328#[doc = "ID: 76"]
9329#[derive(Debug, Clone, PartialEq)]
9330#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9331#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9332#[cfg_attr(feature = "ts", derive(TS))]
9333#[cfg_attr(feature = "ts", ts(export))]
9334pub struct COMMAND_LONG_DATA {
9335 #[doc = "Parameter 1 (for the specific command)."]
9336 pub param1: f32,
9337 #[doc = "Parameter 2 (for the specific command)."]
9338 pub param2: f32,
9339 #[doc = "Parameter 3 (for the specific command)."]
9340 pub param3: f32,
9341 #[doc = "Parameter 4 (for the specific command)."]
9342 pub param4: f32,
9343 #[doc = "Parameter 5 (for the specific command)."]
9344 pub param5: f32,
9345 #[doc = "Parameter 6 (for the specific command)."]
9346 pub param6: f32,
9347 #[doc = "Parameter 7 (for the specific command)."]
9348 pub param7: f32,
9349 #[doc = "Command ID (of command to send)."]
9350 pub command: MavCmd,
9351 #[doc = "System which should execute the command"]
9352 pub target_system: u8,
9353 #[doc = "Component which should execute the command, 0 for all components"]
9354 pub target_component: u8,
9355 #[doc = "0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command)"]
9356 pub confirmation: u8,
9357}
9358impl COMMAND_LONG_DATA {
9359 pub const ENCODED_LEN: usize = 33usize;
9360 pub const DEFAULT: Self = Self {
9361 param1: 0.0_f32,
9362 param2: 0.0_f32,
9363 param3: 0.0_f32,
9364 param4: 0.0_f32,
9365 param5: 0.0_f32,
9366 param6: 0.0_f32,
9367 param7: 0.0_f32,
9368 command: MavCmd::DEFAULT,
9369 target_system: 0_u8,
9370 target_component: 0_u8,
9371 confirmation: 0_u8,
9372 };
9373 #[cfg(feature = "arbitrary")]
9374 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9375 use arbitrary::{Arbitrary, Unstructured};
9376 let mut buf = [0u8; 1024];
9377 rng.fill_bytes(&mut buf);
9378 let mut unstructured = Unstructured::new(&buf);
9379 Self::arbitrary(&mut unstructured).unwrap_or_default()
9380 }
9381}
9382impl Default for COMMAND_LONG_DATA {
9383 fn default() -> Self {
9384 Self::DEFAULT.clone()
9385 }
9386}
9387impl MessageData for COMMAND_LONG_DATA {
9388 type Message = MavMessage;
9389 const ID: u32 = 76u32;
9390 const NAME: &'static str = "COMMAND_LONG";
9391 const EXTRA_CRC: u8 = 152u8;
9392 const ENCODED_LEN: usize = 33usize;
9393 fn deser(
9394 _version: MavlinkVersion,
9395 __input: &[u8],
9396 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9397 let avail_len = __input.len();
9398 let mut payload_buf = [0; Self::ENCODED_LEN];
9399 let mut buf = if avail_len < Self::ENCODED_LEN {
9400 payload_buf[0..avail_len].copy_from_slice(__input);
9401 Bytes::new(&payload_buf)
9402 } else {
9403 Bytes::new(__input)
9404 };
9405 let mut __struct = Self::default();
9406 __struct.param1 = buf.get_f32_le();
9407 __struct.param2 = buf.get_f32_le();
9408 __struct.param3 = buf.get_f32_le();
9409 __struct.param4 = buf.get_f32_le();
9410 __struct.param5 = buf.get_f32_le();
9411 __struct.param6 = buf.get_f32_le();
9412 __struct.param7 = buf.get_f32_le();
9413 let tmp = buf.get_u16_le();
9414 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
9415 ::mavlink_core::error::ParserError::InvalidEnum {
9416 enum_type: "MavCmd",
9417 value: tmp as u64,
9418 },
9419 )?;
9420 __struct.target_system = buf.get_u8();
9421 __struct.target_component = buf.get_u8();
9422 __struct.confirmation = buf.get_u8();
9423 Ok(__struct)
9424 }
9425 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9426 let mut __tmp = BytesMut::new(bytes);
9427 #[allow(clippy::absurd_extreme_comparisons)]
9428 #[allow(unused_comparisons)]
9429 if __tmp.remaining() < Self::ENCODED_LEN {
9430 panic!(
9431 "buffer is too small (need {} bytes, but got {})",
9432 Self::ENCODED_LEN,
9433 __tmp.remaining(),
9434 )
9435 }
9436 __tmp.put_f32_le(self.param1);
9437 __tmp.put_f32_le(self.param2);
9438 __tmp.put_f32_le(self.param3);
9439 __tmp.put_f32_le(self.param4);
9440 __tmp.put_f32_le(self.param5);
9441 __tmp.put_f32_le(self.param6);
9442 __tmp.put_f32_le(self.param7);
9443 __tmp.put_u16_le(self.command as u16);
9444 __tmp.put_u8(self.target_system);
9445 __tmp.put_u8(self.target_component);
9446 __tmp.put_u8(self.confirmation);
9447 if matches!(version, MavlinkVersion::V2) {
9448 let len = __tmp.len();
9449 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9450 } else {
9451 __tmp.len()
9452 }
9453 }
9454}
9455#[deprecated = " See `COMPONENT_METADATA` (Deprecated since 2022-04)"]
9456#[doc = "Component information message, which may be requested using MAV_CMD_REQUEST_MESSAGE."]
9457#[doc = ""]
9458#[doc = "ID: 395"]
9459#[derive(Debug, Clone, PartialEq)]
9460#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9461#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9462#[cfg_attr(feature = "ts", derive(TS))]
9463#[cfg_attr(feature = "ts", ts(export))]
9464pub struct COMPONENT_INFORMATION_DATA {
9465 #[doc = "Timestamp (time since system boot)."]
9466 pub time_boot_ms: u32,
9467 #[doc = "CRC32 of the general metadata file (general_metadata_uri)."]
9468 pub general_metadata_file_crc: u32,
9469 #[doc = "CRC32 of peripherals metadata file (peripherals_metadata_uri)."]
9470 pub peripherals_metadata_file_crc: u32,
9471 #[doc = "MAVLink FTP URI for the general metadata file (COMP_METADATA_TYPE_GENERAL), which may be compressed with xz. The file contains general component metadata, and may contain URI links for additional metadata (see COMP_METADATA_TYPE). The information is static from boot, and may be generated at compile time. The string needs to be zero terminated."]
9472 #[cfg_attr(feature = "ts", ts(type = "string"))]
9473 pub general_metadata_uri: CharArray<100>,
9474 #[doc = "(Optional) MAVLink FTP URI for the peripherals metadata file (COMP_METADATA_TYPE_PERIPHERALS), which may be compressed with xz. This contains data about \"attached components\" such as UAVCAN nodes. The peripherals are in a separate file because the information must be generated dynamically at runtime. The string needs to be zero terminated."]
9475 #[cfg_attr(feature = "ts", ts(type = "string"))]
9476 pub peripherals_metadata_uri: CharArray<100>,
9477}
9478impl COMPONENT_INFORMATION_DATA {
9479 pub const ENCODED_LEN: usize = 212usize;
9480 pub const DEFAULT: Self = Self {
9481 time_boot_ms: 0_u32,
9482 general_metadata_file_crc: 0_u32,
9483 peripherals_metadata_file_crc: 0_u32,
9484 general_metadata_uri: CharArray::new([0_u8; 100usize]),
9485 peripherals_metadata_uri: CharArray::new([0_u8; 100usize]),
9486 };
9487 #[cfg(feature = "arbitrary")]
9488 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9489 use arbitrary::{Arbitrary, Unstructured};
9490 let mut buf = [0u8; 1024];
9491 rng.fill_bytes(&mut buf);
9492 let mut unstructured = Unstructured::new(&buf);
9493 Self::arbitrary(&mut unstructured).unwrap_or_default()
9494 }
9495}
9496impl Default for COMPONENT_INFORMATION_DATA {
9497 fn default() -> Self {
9498 Self::DEFAULT.clone()
9499 }
9500}
9501impl MessageData for COMPONENT_INFORMATION_DATA {
9502 type Message = MavMessage;
9503 const ID: u32 = 395u32;
9504 const NAME: &'static str = "COMPONENT_INFORMATION";
9505 const EXTRA_CRC: u8 = 0u8;
9506 const ENCODED_LEN: usize = 212usize;
9507 fn deser(
9508 _version: MavlinkVersion,
9509 __input: &[u8],
9510 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9511 let avail_len = __input.len();
9512 let mut payload_buf = [0; Self::ENCODED_LEN];
9513 let mut buf = if avail_len < Self::ENCODED_LEN {
9514 payload_buf[0..avail_len].copy_from_slice(__input);
9515 Bytes::new(&payload_buf)
9516 } else {
9517 Bytes::new(__input)
9518 };
9519 let mut __struct = Self::default();
9520 __struct.time_boot_ms = buf.get_u32_le();
9521 __struct.general_metadata_file_crc = buf.get_u32_le();
9522 __struct.peripherals_metadata_file_crc = buf.get_u32_le();
9523 let mut tmp = [0_u8; 100usize];
9524 for v in &mut tmp {
9525 *v = buf.get_u8();
9526 }
9527 __struct.general_metadata_uri = CharArray::new(tmp);
9528 let mut tmp = [0_u8; 100usize];
9529 for v in &mut tmp {
9530 *v = buf.get_u8();
9531 }
9532 __struct.peripherals_metadata_uri = CharArray::new(tmp);
9533 Ok(__struct)
9534 }
9535 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9536 let mut __tmp = BytesMut::new(bytes);
9537 #[allow(clippy::absurd_extreme_comparisons)]
9538 #[allow(unused_comparisons)]
9539 if __tmp.remaining() < Self::ENCODED_LEN {
9540 panic!(
9541 "buffer is too small (need {} bytes, but got {})",
9542 Self::ENCODED_LEN,
9543 __tmp.remaining(),
9544 )
9545 }
9546 __tmp.put_u32_le(self.time_boot_ms);
9547 __tmp.put_u32_le(self.general_metadata_file_crc);
9548 __tmp.put_u32_le(self.peripherals_metadata_file_crc);
9549 for val in &self.general_metadata_uri {
9550 __tmp.put_u8(*val);
9551 }
9552 for val in &self.peripherals_metadata_uri {
9553 __tmp.put_u8(*val);
9554 }
9555 if matches!(version, MavlinkVersion::V2) {
9556 let len = __tmp.len();
9557 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9558 } else {
9559 __tmp.len()
9560 }
9561 }
9562}
9563#[doc = "Basic component information data. Should be requested using MAV_CMD_REQUEST_MESSAGE on startup, or when required."]
9564#[doc = ""]
9565#[doc = "ID: 396"]
9566#[derive(Debug, Clone, PartialEq)]
9567#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9568#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9569#[cfg_attr(feature = "ts", derive(TS))]
9570#[cfg_attr(feature = "ts", ts(export))]
9571pub struct COMPONENT_INFORMATION_BASIC_DATA {
9572 #[doc = "Component capability flags"]
9573 pub capabilities: MavProtocolCapability,
9574 #[doc = "Timestamp (time since system boot)."]
9575 pub time_boot_ms: u32,
9576 #[doc = "Date of manufacture as a UNIX Epoch time (since 1.1.1970) in seconds."]
9577 pub time_manufacture_s: u32,
9578 #[doc = "Name of the component vendor. Needs to be zero terminated. The field is optional and can be empty/all zeros."]
9579 #[cfg_attr(feature = "ts", ts(type = "string"))]
9580 pub vendor_name: CharArray<32>,
9581 #[doc = "Name of the component model. Needs to be zero terminated. The field is optional and can be empty/all zeros."]
9582 #[cfg_attr(feature = "ts", ts(type = "string"))]
9583 pub model_name: CharArray<32>,
9584 #[doc = "Software version. The recommended format is SEMVER: 'major.minor.patch' (any format may be used). The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
9585 #[cfg_attr(feature = "ts", ts(type = "string"))]
9586 pub software_version: CharArray<24>,
9587 #[doc = "Hardware version. The recommended format is SEMVER: 'major.minor.patch' (any format may be used). The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
9588 #[cfg_attr(feature = "ts", ts(type = "string"))]
9589 pub hardware_version: CharArray<24>,
9590 #[doc = "Hardware serial number. The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
9591 #[cfg_attr(feature = "ts", ts(type = "string"))]
9592 pub serial_number: CharArray<32>,
9593}
9594impl COMPONENT_INFORMATION_BASIC_DATA {
9595 pub const ENCODED_LEN: usize = 160usize;
9596 pub const DEFAULT: Self = Self {
9597 capabilities: MavProtocolCapability::DEFAULT,
9598 time_boot_ms: 0_u32,
9599 time_manufacture_s: 0_u32,
9600 vendor_name: CharArray::new([0_u8; 32usize]),
9601 model_name: CharArray::new([0_u8; 32usize]),
9602 software_version: CharArray::new([0_u8; 24usize]),
9603 hardware_version: CharArray::new([0_u8; 24usize]),
9604 serial_number: CharArray::new([0_u8; 32usize]),
9605 };
9606 #[cfg(feature = "arbitrary")]
9607 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9608 use arbitrary::{Arbitrary, Unstructured};
9609 let mut buf = [0u8; 1024];
9610 rng.fill_bytes(&mut buf);
9611 let mut unstructured = Unstructured::new(&buf);
9612 Self::arbitrary(&mut unstructured).unwrap_or_default()
9613 }
9614}
9615impl Default for COMPONENT_INFORMATION_BASIC_DATA {
9616 fn default() -> Self {
9617 Self::DEFAULT.clone()
9618 }
9619}
9620impl MessageData for COMPONENT_INFORMATION_BASIC_DATA {
9621 type Message = MavMessage;
9622 const ID: u32 = 396u32;
9623 const NAME: &'static str = "COMPONENT_INFORMATION_BASIC";
9624 const EXTRA_CRC: u8 = 50u8;
9625 const ENCODED_LEN: usize = 160usize;
9626 fn deser(
9627 _version: MavlinkVersion,
9628 __input: &[u8],
9629 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9630 let avail_len = __input.len();
9631 let mut payload_buf = [0; Self::ENCODED_LEN];
9632 let mut buf = if avail_len < Self::ENCODED_LEN {
9633 payload_buf[0..avail_len].copy_from_slice(__input);
9634 Bytes::new(&payload_buf)
9635 } else {
9636 Bytes::new(__input)
9637 };
9638 let mut __struct = Self::default();
9639 let tmp = buf.get_u64_le();
9640 __struct.capabilities = MavProtocolCapability::from_bits(tmp).ok_or(
9641 ::mavlink_core::error::ParserError::InvalidFlag {
9642 flag_type: "MavProtocolCapability",
9643 value: tmp as u64,
9644 },
9645 )?;
9646 __struct.time_boot_ms = buf.get_u32_le();
9647 __struct.time_manufacture_s = buf.get_u32_le();
9648 let mut tmp = [0_u8; 32usize];
9649 for v in &mut tmp {
9650 *v = buf.get_u8();
9651 }
9652 __struct.vendor_name = CharArray::new(tmp);
9653 let mut tmp = [0_u8; 32usize];
9654 for v in &mut tmp {
9655 *v = buf.get_u8();
9656 }
9657 __struct.model_name = CharArray::new(tmp);
9658 let mut tmp = [0_u8; 24usize];
9659 for v in &mut tmp {
9660 *v = buf.get_u8();
9661 }
9662 __struct.software_version = CharArray::new(tmp);
9663 let mut tmp = [0_u8; 24usize];
9664 for v in &mut tmp {
9665 *v = buf.get_u8();
9666 }
9667 __struct.hardware_version = CharArray::new(tmp);
9668 let mut tmp = [0_u8; 32usize];
9669 for v in &mut tmp {
9670 *v = buf.get_u8();
9671 }
9672 __struct.serial_number = CharArray::new(tmp);
9673 Ok(__struct)
9674 }
9675 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9676 let mut __tmp = BytesMut::new(bytes);
9677 #[allow(clippy::absurd_extreme_comparisons)]
9678 #[allow(unused_comparisons)]
9679 if __tmp.remaining() < Self::ENCODED_LEN {
9680 panic!(
9681 "buffer is too small (need {} bytes, but got {})",
9682 Self::ENCODED_LEN,
9683 __tmp.remaining(),
9684 )
9685 }
9686 __tmp.put_u64_le(self.capabilities.bits());
9687 __tmp.put_u32_le(self.time_boot_ms);
9688 __tmp.put_u32_le(self.time_manufacture_s);
9689 for val in &self.vendor_name {
9690 __tmp.put_u8(*val);
9691 }
9692 for val in &self.model_name {
9693 __tmp.put_u8(*val);
9694 }
9695 for val in &self.software_version {
9696 __tmp.put_u8(*val);
9697 }
9698 for val in &self.hardware_version {
9699 __tmp.put_u8(*val);
9700 }
9701 for val in &self.serial_number {
9702 __tmp.put_u8(*val);
9703 }
9704 if matches!(version, MavlinkVersion::V2) {
9705 let len = __tmp.len();
9706 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9707 } else {
9708 __tmp.len()
9709 }
9710 }
9711}
9712#[doc = "Component metadata message, which may be requested using MAV_CMD_REQUEST_MESSAGE. This contains the MAVLink FTP URI and CRC for the component's general metadata file. The file must be hosted on the component, and may be xz compressed. The file CRC can be used for file caching. The general metadata file can be read to get the locations of other metadata files (COMP_METADATA_TYPE) and translations, which may be hosted either on the vehicle or the internet. For more information see: <https://mavlink.io/en/services/component_information.html>. Note: Camera components should use CAMERA_INFORMATION instead, and autopilots may use both this message and AUTOPILOT_VERSION."]
9713#[doc = ""]
9714#[doc = "ID: 397"]
9715#[derive(Debug, Clone, PartialEq)]
9716#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9717#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9718#[cfg_attr(feature = "ts", derive(TS))]
9719#[cfg_attr(feature = "ts", ts(export))]
9720pub struct COMPONENT_METADATA_DATA {
9721 #[doc = "Timestamp (time since system boot)."]
9722 pub time_boot_ms: u32,
9723 #[doc = "CRC32 of the general metadata file."]
9724 pub file_crc: u32,
9725 #[doc = "MAVLink FTP URI for the general metadata file (COMP_METADATA_TYPE_GENERAL), which may be compressed with xz. The file contains general component metadata, and may contain URI links for additional metadata (see COMP_METADATA_TYPE). The information is static from boot, and may be generated at compile time. The string needs to be zero terminated."]
9726 #[cfg_attr(feature = "ts", ts(type = "string"))]
9727 pub uri: CharArray<100>,
9728}
9729impl COMPONENT_METADATA_DATA {
9730 pub const ENCODED_LEN: usize = 108usize;
9731 pub const DEFAULT: Self = Self {
9732 time_boot_ms: 0_u32,
9733 file_crc: 0_u32,
9734 uri: CharArray::new([0_u8; 100usize]),
9735 };
9736 #[cfg(feature = "arbitrary")]
9737 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9738 use arbitrary::{Arbitrary, Unstructured};
9739 let mut buf = [0u8; 1024];
9740 rng.fill_bytes(&mut buf);
9741 let mut unstructured = Unstructured::new(&buf);
9742 Self::arbitrary(&mut unstructured).unwrap_or_default()
9743 }
9744}
9745impl Default for COMPONENT_METADATA_DATA {
9746 fn default() -> Self {
9747 Self::DEFAULT.clone()
9748 }
9749}
9750impl MessageData for COMPONENT_METADATA_DATA {
9751 type Message = MavMessage;
9752 const ID: u32 = 397u32;
9753 const NAME: &'static str = "COMPONENT_METADATA";
9754 const EXTRA_CRC: u8 = 182u8;
9755 const ENCODED_LEN: usize = 108usize;
9756 fn deser(
9757 _version: MavlinkVersion,
9758 __input: &[u8],
9759 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9760 let avail_len = __input.len();
9761 let mut payload_buf = [0; Self::ENCODED_LEN];
9762 let mut buf = if avail_len < Self::ENCODED_LEN {
9763 payload_buf[0..avail_len].copy_from_slice(__input);
9764 Bytes::new(&payload_buf)
9765 } else {
9766 Bytes::new(__input)
9767 };
9768 let mut __struct = Self::default();
9769 __struct.time_boot_ms = buf.get_u32_le();
9770 __struct.file_crc = buf.get_u32_le();
9771 let mut tmp = [0_u8; 100usize];
9772 for v in &mut tmp {
9773 *v = buf.get_u8();
9774 }
9775 __struct.uri = CharArray::new(tmp);
9776 Ok(__struct)
9777 }
9778 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9779 let mut __tmp = BytesMut::new(bytes);
9780 #[allow(clippy::absurd_extreme_comparisons)]
9781 #[allow(unused_comparisons)]
9782 if __tmp.remaining() < Self::ENCODED_LEN {
9783 panic!(
9784 "buffer is too small (need {} bytes, but got {})",
9785 Self::ENCODED_LEN,
9786 __tmp.remaining(),
9787 )
9788 }
9789 __tmp.put_u32_le(self.time_boot_ms);
9790 __tmp.put_u32_le(self.file_crc);
9791 for val in &self.uri {
9792 __tmp.put_u8(*val);
9793 }
9794 if matches!(version, MavlinkVersion::V2) {
9795 let len = __tmp.len();
9796 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9797 } else {
9798 __tmp.len()
9799 }
9800 }
9801}
9802#[doc = "The smoothed, monotonic system state used to feed the control loops of the system."]
9803#[doc = ""]
9804#[doc = "ID: 146"]
9805#[derive(Debug, Clone, PartialEq)]
9806#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9807#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9808#[cfg_attr(feature = "ts", derive(TS))]
9809#[cfg_attr(feature = "ts", ts(export))]
9810pub struct CONTROL_SYSTEM_STATE_DATA {
9811 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
9812 pub time_usec: u64,
9813 #[doc = "X acceleration in body frame"]
9814 pub x_acc: f32,
9815 #[doc = "Y acceleration in body frame"]
9816 pub y_acc: f32,
9817 #[doc = "Z acceleration in body frame"]
9818 pub z_acc: f32,
9819 #[doc = "X velocity in body frame"]
9820 pub x_vel: f32,
9821 #[doc = "Y velocity in body frame"]
9822 pub y_vel: f32,
9823 #[doc = "Z velocity in body frame"]
9824 pub z_vel: f32,
9825 #[doc = "X position in local frame"]
9826 pub x_pos: f32,
9827 #[doc = "Y position in local frame"]
9828 pub y_pos: f32,
9829 #[doc = "Z position in local frame"]
9830 pub z_pos: f32,
9831 #[doc = "Airspeed, set to -1 if unknown"]
9832 pub airspeed: f32,
9833 #[doc = "Variance of body velocity estimate"]
9834 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9835 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
9836 pub vel_variance: [f32; 3],
9837 #[doc = "Variance in local position"]
9838 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9839 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
9840 pub pos_variance: [f32; 3],
9841 #[doc = "The attitude, represented as Quaternion"]
9842 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9843 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
9844 pub q: [f32; 4],
9845 #[doc = "Angular rate in roll axis"]
9846 pub roll_rate: f32,
9847 #[doc = "Angular rate in pitch axis"]
9848 pub pitch_rate: f32,
9849 #[doc = "Angular rate in yaw axis"]
9850 pub yaw_rate: f32,
9851}
9852impl CONTROL_SYSTEM_STATE_DATA {
9853 pub const ENCODED_LEN: usize = 100usize;
9854 pub const DEFAULT: Self = Self {
9855 time_usec: 0_u64,
9856 x_acc: 0.0_f32,
9857 y_acc: 0.0_f32,
9858 z_acc: 0.0_f32,
9859 x_vel: 0.0_f32,
9860 y_vel: 0.0_f32,
9861 z_vel: 0.0_f32,
9862 x_pos: 0.0_f32,
9863 y_pos: 0.0_f32,
9864 z_pos: 0.0_f32,
9865 airspeed: 0.0_f32,
9866 vel_variance: [0.0_f32; 3usize],
9867 pos_variance: [0.0_f32; 3usize],
9868 q: [0.0_f32; 4usize],
9869 roll_rate: 0.0_f32,
9870 pitch_rate: 0.0_f32,
9871 yaw_rate: 0.0_f32,
9872 };
9873 #[cfg(feature = "arbitrary")]
9874 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9875 use arbitrary::{Arbitrary, Unstructured};
9876 let mut buf = [0u8; 1024];
9877 rng.fill_bytes(&mut buf);
9878 let mut unstructured = Unstructured::new(&buf);
9879 Self::arbitrary(&mut unstructured).unwrap_or_default()
9880 }
9881}
9882impl Default for CONTROL_SYSTEM_STATE_DATA {
9883 fn default() -> Self {
9884 Self::DEFAULT.clone()
9885 }
9886}
9887impl MessageData for CONTROL_SYSTEM_STATE_DATA {
9888 type Message = MavMessage;
9889 const ID: u32 = 146u32;
9890 const NAME: &'static str = "CONTROL_SYSTEM_STATE";
9891 const EXTRA_CRC: u8 = 103u8;
9892 const ENCODED_LEN: usize = 100usize;
9893 fn deser(
9894 _version: MavlinkVersion,
9895 __input: &[u8],
9896 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9897 let avail_len = __input.len();
9898 let mut payload_buf = [0; Self::ENCODED_LEN];
9899 let mut buf = if avail_len < Self::ENCODED_LEN {
9900 payload_buf[0..avail_len].copy_from_slice(__input);
9901 Bytes::new(&payload_buf)
9902 } else {
9903 Bytes::new(__input)
9904 };
9905 let mut __struct = Self::default();
9906 __struct.time_usec = buf.get_u64_le();
9907 __struct.x_acc = buf.get_f32_le();
9908 __struct.y_acc = buf.get_f32_le();
9909 __struct.z_acc = buf.get_f32_le();
9910 __struct.x_vel = buf.get_f32_le();
9911 __struct.y_vel = buf.get_f32_le();
9912 __struct.z_vel = buf.get_f32_le();
9913 __struct.x_pos = buf.get_f32_le();
9914 __struct.y_pos = buf.get_f32_le();
9915 __struct.z_pos = buf.get_f32_le();
9916 __struct.airspeed = buf.get_f32_le();
9917 for v in &mut __struct.vel_variance {
9918 let val = buf.get_f32_le();
9919 *v = val;
9920 }
9921 for v in &mut __struct.pos_variance {
9922 let val = buf.get_f32_le();
9923 *v = val;
9924 }
9925 for v in &mut __struct.q {
9926 let val = buf.get_f32_le();
9927 *v = val;
9928 }
9929 __struct.roll_rate = buf.get_f32_le();
9930 __struct.pitch_rate = buf.get_f32_le();
9931 __struct.yaw_rate = buf.get_f32_le();
9932 Ok(__struct)
9933 }
9934 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9935 let mut __tmp = BytesMut::new(bytes);
9936 #[allow(clippy::absurd_extreme_comparisons)]
9937 #[allow(unused_comparisons)]
9938 if __tmp.remaining() < Self::ENCODED_LEN {
9939 panic!(
9940 "buffer is too small (need {} bytes, but got {})",
9941 Self::ENCODED_LEN,
9942 __tmp.remaining(),
9943 )
9944 }
9945 __tmp.put_u64_le(self.time_usec);
9946 __tmp.put_f32_le(self.x_acc);
9947 __tmp.put_f32_le(self.y_acc);
9948 __tmp.put_f32_le(self.z_acc);
9949 __tmp.put_f32_le(self.x_vel);
9950 __tmp.put_f32_le(self.y_vel);
9951 __tmp.put_f32_le(self.z_vel);
9952 __tmp.put_f32_le(self.x_pos);
9953 __tmp.put_f32_le(self.y_pos);
9954 __tmp.put_f32_le(self.z_pos);
9955 __tmp.put_f32_le(self.airspeed);
9956 for val in &self.vel_variance {
9957 __tmp.put_f32_le(*val);
9958 }
9959 for val in &self.pos_variance {
9960 __tmp.put_f32_le(*val);
9961 }
9962 for val in &self.q {
9963 __tmp.put_f32_le(*val);
9964 }
9965 __tmp.put_f32_le(self.roll_rate);
9966 __tmp.put_f32_le(self.pitch_rate);
9967 __tmp.put_f32_le(self.yaw_rate);
9968 if matches!(version, MavlinkVersion::V2) {
9969 let len = __tmp.len();
9970 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9971 } else {
9972 __tmp.len()
9973 }
9974 }
9975}
9976#[doc = "Regular broadcast for the current latest event sequence number for a component. This is used to check for dropped events."]
9977#[doc = ""]
9978#[doc = "ID: 411"]
9979#[derive(Debug, Clone, PartialEq)]
9980#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9981#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9982#[cfg_attr(feature = "ts", derive(TS))]
9983#[cfg_attr(feature = "ts", ts(export))]
9984pub struct CURRENT_EVENT_SEQUENCE_DATA {
9985 #[doc = "Sequence number."]
9986 pub sequence: u16,
9987 #[doc = "Flag bitset."]
9988 pub flags: MavEventCurrentSequenceFlags,
9989}
9990impl CURRENT_EVENT_SEQUENCE_DATA {
9991 pub const ENCODED_LEN: usize = 3usize;
9992 pub const DEFAULT: Self = Self {
9993 sequence: 0_u16,
9994 flags: MavEventCurrentSequenceFlags::DEFAULT,
9995 };
9996 #[cfg(feature = "arbitrary")]
9997 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9998 use arbitrary::{Arbitrary, Unstructured};
9999 let mut buf = [0u8; 1024];
10000 rng.fill_bytes(&mut buf);
10001 let mut unstructured = Unstructured::new(&buf);
10002 Self::arbitrary(&mut unstructured).unwrap_or_default()
10003 }
10004}
10005impl Default for CURRENT_EVENT_SEQUENCE_DATA {
10006 fn default() -> Self {
10007 Self::DEFAULT.clone()
10008 }
10009}
10010impl MessageData for CURRENT_EVENT_SEQUENCE_DATA {
10011 type Message = MavMessage;
10012 const ID: u32 = 411u32;
10013 const NAME: &'static str = "CURRENT_EVENT_SEQUENCE";
10014 const EXTRA_CRC: u8 = 106u8;
10015 const ENCODED_LEN: usize = 3usize;
10016 fn deser(
10017 _version: MavlinkVersion,
10018 __input: &[u8],
10019 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10020 let avail_len = __input.len();
10021 let mut payload_buf = [0; Self::ENCODED_LEN];
10022 let mut buf = if avail_len < Self::ENCODED_LEN {
10023 payload_buf[0..avail_len].copy_from_slice(__input);
10024 Bytes::new(&payload_buf)
10025 } else {
10026 Bytes::new(__input)
10027 };
10028 let mut __struct = Self::default();
10029 __struct.sequence = buf.get_u16_le();
10030 let tmp = buf.get_u8();
10031 __struct.flags =
10032 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10033 enum_type: "MavEventCurrentSequenceFlags",
10034 value: tmp as u64,
10035 })?;
10036 Ok(__struct)
10037 }
10038 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10039 let mut __tmp = BytesMut::new(bytes);
10040 #[allow(clippy::absurd_extreme_comparisons)]
10041 #[allow(unused_comparisons)]
10042 if __tmp.remaining() < Self::ENCODED_LEN {
10043 panic!(
10044 "buffer is too small (need {} bytes, but got {})",
10045 Self::ENCODED_LEN,
10046 __tmp.remaining(),
10047 )
10048 }
10049 __tmp.put_u16_le(self.sequence);
10050 __tmp.put_u8(self.flags as u8);
10051 if matches!(version, MavlinkVersion::V2) {
10052 let len = __tmp.len();
10053 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10054 } else {
10055 __tmp.len()
10056 }
10057 }
10058}
10059#[doc = "Get the current mode. This should be emitted on any mode change, and broadcast at low rate (nominally 0.5 Hz). It may be requested using MAV_CMD_REQUEST_MESSAGE. See <https://mavlink.io/en/services/standard_modes.html>."]
10060#[doc = ""]
10061#[doc = "ID: 436"]
10062#[derive(Debug, Clone, PartialEq)]
10063#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10064#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10065#[cfg_attr(feature = "ts", derive(TS))]
10066#[cfg_attr(feature = "ts", ts(export))]
10067pub struct CURRENT_MODE_DATA {
10068 #[doc = "A bitfield for use for autopilot-specific flags"]
10069 pub custom_mode: u32,
10070 #[doc = "The custom_mode of the mode that was last commanded by the user (for example, with MAV_CMD_DO_SET_STANDARD_MODE, MAV_CMD_DO_SET_MODE or via RC). This should usually be the same as custom_mode. It will be different if the vehicle is unable to enter the intended mode, or has left that mode due to a failsafe condition. 0 indicates the intended custom mode is unknown/not supplied"]
10071 pub intended_custom_mode: u32,
10072 #[doc = "Standard mode."]
10073 pub standard_mode: MavStandardMode,
10074}
10075impl CURRENT_MODE_DATA {
10076 pub const ENCODED_LEN: usize = 9usize;
10077 pub const DEFAULT: Self = Self {
10078 custom_mode: 0_u32,
10079 intended_custom_mode: 0_u32,
10080 standard_mode: MavStandardMode::DEFAULT,
10081 };
10082 #[cfg(feature = "arbitrary")]
10083 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10084 use arbitrary::{Arbitrary, Unstructured};
10085 let mut buf = [0u8; 1024];
10086 rng.fill_bytes(&mut buf);
10087 let mut unstructured = Unstructured::new(&buf);
10088 Self::arbitrary(&mut unstructured).unwrap_or_default()
10089 }
10090}
10091impl Default for CURRENT_MODE_DATA {
10092 fn default() -> Self {
10093 Self::DEFAULT.clone()
10094 }
10095}
10096impl MessageData for CURRENT_MODE_DATA {
10097 type Message = MavMessage;
10098 const ID: u32 = 436u32;
10099 const NAME: &'static str = "CURRENT_MODE";
10100 const EXTRA_CRC: u8 = 193u8;
10101 const ENCODED_LEN: usize = 9usize;
10102 fn deser(
10103 _version: MavlinkVersion,
10104 __input: &[u8],
10105 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10106 let avail_len = __input.len();
10107 let mut payload_buf = [0; Self::ENCODED_LEN];
10108 let mut buf = if avail_len < Self::ENCODED_LEN {
10109 payload_buf[0..avail_len].copy_from_slice(__input);
10110 Bytes::new(&payload_buf)
10111 } else {
10112 Bytes::new(__input)
10113 };
10114 let mut __struct = Self::default();
10115 __struct.custom_mode = buf.get_u32_le();
10116 __struct.intended_custom_mode = buf.get_u32_le();
10117 let tmp = buf.get_u8();
10118 __struct.standard_mode =
10119 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10120 enum_type: "MavStandardMode",
10121 value: tmp as u64,
10122 })?;
10123 Ok(__struct)
10124 }
10125 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10126 let mut __tmp = BytesMut::new(bytes);
10127 #[allow(clippy::absurd_extreme_comparisons)]
10128 #[allow(unused_comparisons)]
10129 if __tmp.remaining() < Self::ENCODED_LEN {
10130 panic!(
10131 "buffer is too small (need {} bytes, but got {})",
10132 Self::ENCODED_LEN,
10133 __tmp.remaining(),
10134 )
10135 }
10136 __tmp.put_u32_le(self.custom_mode);
10137 __tmp.put_u32_le(self.intended_custom_mode);
10138 __tmp.put_u8(self.standard_mode as u8);
10139 if matches!(version, MavlinkVersion::V2) {
10140 let len = __tmp.len();
10141 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10142 } else {
10143 __tmp.len()
10144 }
10145 }
10146}
10147#[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-08)"]
10148#[doc = "Data stream status information."]
10149#[doc = ""]
10150#[doc = "ID: 67"]
10151#[derive(Debug, Clone, PartialEq)]
10152#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10153#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10154#[cfg_attr(feature = "ts", derive(TS))]
10155#[cfg_attr(feature = "ts", ts(export))]
10156pub struct DATA_STREAM_DATA {
10157 #[doc = "The message rate"]
10158 pub message_rate: u16,
10159 #[doc = "The ID of the requested data stream"]
10160 pub stream_id: u8,
10161 #[doc = "1 stream is enabled, 0 stream is stopped."]
10162 pub on_off: u8,
10163}
10164impl DATA_STREAM_DATA {
10165 pub const ENCODED_LEN: usize = 4usize;
10166 pub const DEFAULT: Self = Self {
10167 message_rate: 0_u16,
10168 stream_id: 0_u8,
10169 on_off: 0_u8,
10170 };
10171 #[cfg(feature = "arbitrary")]
10172 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10173 use arbitrary::{Arbitrary, Unstructured};
10174 let mut buf = [0u8; 1024];
10175 rng.fill_bytes(&mut buf);
10176 let mut unstructured = Unstructured::new(&buf);
10177 Self::arbitrary(&mut unstructured).unwrap_or_default()
10178 }
10179}
10180impl Default for DATA_STREAM_DATA {
10181 fn default() -> Self {
10182 Self::DEFAULT.clone()
10183 }
10184}
10185impl MessageData for DATA_STREAM_DATA {
10186 type Message = MavMessage;
10187 const ID: u32 = 67u32;
10188 const NAME: &'static str = "DATA_STREAM";
10189 const EXTRA_CRC: u8 = 21u8;
10190 const ENCODED_LEN: usize = 4usize;
10191 fn deser(
10192 _version: MavlinkVersion,
10193 __input: &[u8],
10194 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10195 let avail_len = __input.len();
10196 let mut payload_buf = [0; Self::ENCODED_LEN];
10197 let mut buf = if avail_len < Self::ENCODED_LEN {
10198 payload_buf[0..avail_len].copy_from_slice(__input);
10199 Bytes::new(&payload_buf)
10200 } else {
10201 Bytes::new(__input)
10202 };
10203 let mut __struct = Self::default();
10204 __struct.message_rate = buf.get_u16_le();
10205 __struct.stream_id = buf.get_u8();
10206 __struct.on_off = buf.get_u8();
10207 Ok(__struct)
10208 }
10209 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10210 let mut __tmp = BytesMut::new(bytes);
10211 #[allow(clippy::absurd_extreme_comparisons)]
10212 #[allow(unused_comparisons)]
10213 if __tmp.remaining() < Self::ENCODED_LEN {
10214 panic!(
10215 "buffer is too small (need {} bytes, but got {})",
10216 Self::ENCODED_LEN,
10217 __tmp.remaining(),
10218 )
10219 }
10220 __tmp.put_u16_le(self.message_rate);
10221 __tmp.put_u8(self.stream_id);
10222 __tmp.put_u8(self.on_off);
10223 if matches!(version, MavlinkVersion::V2) {
10224 let len = __tmp.len();
10225 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10226 } else {
10227 __tmp.len()
10228 }
10229 }
10230}
10231#[doc = "Handshake message to initiate, control and stop image streaming when using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
10232#[doc = ""]
10233#[doc = "ID: 130"]
10234#[derive(Debug, Clone, PartialEq)]
10235#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10236#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10237#[cfg_attr(feature = "ts", derive(TS))]
10238#[cfg_attr(feature = "ts", ts(export))]
10239pub struct DATA_TRANSMISSION_HANDSHAKE_DATA {
10240 #[doc = "total data size (set on ACK only)."]
10241 pub size: u32,
10242 #[doc = "Width of a matrix or image."]
10243 pub width: u16,
10244 #[doc = "Height of a matrix or image."]
10245 pub height: u16,
10246 #[doc = "Number of packets being sent (set on ACK only)."]
10247 pub packets: u16,
10248 #[doc = "Type of requested/acknowledged data."]
10249 pub mavtype: MavlinkDataStreamType,
10250 #[doc = "Payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only)."]
10251 pub payload: u8,
10252 #[doc = "JPEG quality. Values: [1-100]."]
10253 pub jpg_quality: u8,
10254}
10255impl DATA_TRANSMISSION_HANDSHAKE_DATA {
10256 pub const ENCODED_LEN: usize = 13usize;
10257 pub const DEFAULT: Self = Self {
10258 size: 0_u32,
10259 width: 0_u16,
10260 height: 0_u16,
10261 packets: 0_u16,
10262 mavtype: MavlinkDataStreamType::DEFAULT,
10263 payload: 0_u8,
10264 jpg_quality: 0_u8,
10265 };
10266 #[cfg(feature = "arbitrary")]
10267 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10268 use arbitrary::{Arbitrary, Unstructured};
10269 let mut buf = [0u8; 1024];
10270 rng.fill_bytes(&mut buf);
10271 let mut unstructured = Unstructured::new(&buf);
10272 Self::arbitrary(&mut unstructured).unwrap_or_default()
10273 }
10274}
10275impl Default for DATA_TRANSMISSION_HANDSHAKE_DATA {
10276 fn default() -> Self {
10277 Self::DEFAULT.clone()
10278 }
10279}
10280impl MessageData for DATA_TRANSMISSION_HANDSHAKE_DATA {
10281 type Message = MavMessage;
10282 const ID: u32 = 130u32;
10283 const NAME: &'static str = "DATA_TRANSMISSION_HANDSHAKE";
10284 const EXTRA_CRC: u8 = 29u8;
10285 const ENCODED_LEN: usize = 13usize;
10286 fn deser(
10287 _version: MavlinkVersion,
10288 __input: &[u8],
10289 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10290 let avail_len = __input.len();
10291 let mut payload_buf = [0; Self::ENCODED_LEN];
10292 let mut buf = if avail_len < Self::ENCODED_LEN {
10293 payload_buf[0..avail_len].copy_from_slice(__input);
10294 Bytes::new(&payload_buf)
10295 } else {
10296 Bytes::new(__input)
10297 };
10298 let mut __struct = Self::default();
10299 __struct.size = buf.get_u32_le();
10300 __struct.width = buf.get_u16_le();
10301 __struct.height = buf.get_u16_le();
10302 __struct.packets = buf.get_u16_le();
10303 let tmp = buf.get_u8();
10304 __struct.mavtype =
10305 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10306 enum_type: "MavlinkDataStreamType",
10307 value: tmp as u64,
10308 })?;
10309 __struct.payload = buf.get_u8();
10310 __struct.jpg_quality = buf.get_u8();
10311 Ok(__struct)
10312 }
10313 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10314 let mut __tmp = BytesMut::new(bytes);
10315 #[allow(clippy::absurd_extreme_comparisons)]
10316 #[allow(unused_comparisons)]
10317 if __tmp.remaining() < Self::ENCODED_LEN {
10318 panic!(
10319 "buffer is too small (need {} bytes, but got {})",
10320 Self::ENCODED_LEN,
10321 __tmp.remaining(),
10322 )
10323 }
10324 __tmp.put_u32_le(self.size);
10325 __tmp.put_u16_le(self.width);
10326 __tmp.put_u16_le(self.height);
10327 __tmp.put_u16_le(self.packets);
10328 __tmp.put_u8(self.mavtype as u8);
10329 __tmp.put_u8(self.payload);
10330 __tmp.put_u8(self.jpg_quality);
10331 if matches!(version, MavlinkVersion::V2) {
10332 let len = __tmp.len();
10333 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10334 } else {
10335 __tmp.len()
10336 }
10337 }
10338}
10339#[doc = "Send a debug value. The index is used to discriminate between values. These values show up in the plot of QGroundControl as DEBUG N."]
10340#[doc = ""]
10341#[doc = "ID: 254"]
10342#[derive(Debug, Clone, PartialEq)]
10343#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10344#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10345#[cfg_attr(feature = "ts", derive(TS))]
10346#[cfg_attr(feature = "ts", ts(export))]
10347pub struct DEBUG_DATA {
10348 #[doc = "Timestamp (time since system boot)."]
10349 pub time_boot_ms: u32,
10350 #[doc = "DEBUG value"]
10351 pub value: f32,
10352 #[doc = "index of debug variable"]
10353 pub ind: u8,
10354}
10355impl DEBUG_DATA {
10356 pub const ENCODED_LEN: usize = 9usize;
10357 pub const DEFAULT: Self = Self {
10358 time_boot_ms: 0_u32,
10359 value: 0.0_f32,
10360 ind: 0_u8,
10361 };
10362 #[cfg(feature = "arbitrary")]
10363 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10364 use arbitrary::{Arbitrary, Unstructured};
10365 let mut buf = [0u8; 1024];
10366 rng.fill_bytes(&mut buf);
10367 let mut unstructured = Unstructured::new(&buf);
10368 Self::arbitrary(&mut unstructured).unwrap_or_default()
10369 }
10370}
10371impl Default for DEBUG_DATA {
10372 fn default() -> Self {
10373 Self::DEFAULT.clone()
10374 }
10375}
10376impl MessageData for DEBUG_DATA {
10377 type Message = MavMessage;
10378 const ID: u32 = 254u32;
10379 const NAME: &'static str = "DEBUG";
10380 const EXTRA_CRC: u8 = 46u8;
10381 const ENCODED_LEN: usize = 9usize;
10382 fn deser(
10383 _version: MavlinkVersion,
10384 __input: &[u8],
10385 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10386 let avail_len = __input.len();
10387 let mut payload_buf = [0; Self::ENCODED_LEN];
10388 let mut buf = if avail_len < Self::ENCODED_LEN {
10389 payload_buf[0..avail_len].copy_from_slice(__input);
10390 Bytes::new(&payload_buf)
10391 } else {
10392 Bytes::new(__input)
10393 };
10394 let mut __struct = Self::default();
10395 __struct.time_boot_ms = buf.get_u32_le();
10396 __struct.value = buf.get_f32_le();
10397 __struct.ind = buf.get_u8();
10398 Ok(__struct)
10399 }
10400 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10401 let mut __tmp = BytesMut::new(bytes);
10402 #[allow(clippy::absurd_extreme_comparisons)]
10403 #[allow(unused_comparisons)]
10404 if __tmp.remaining() < Self::ENCODED_LEN {
10405 panic!(
10406 "buffer is too small (need {} bytes, but got {})",
10407 Self::ENCODED_LEN,
10408 __tmp.remaining(),
10409 )
10410 }
10411 __tmp.put_u32_le(self.time_boot_ms);
10412 __tmp.put_f32_le(self.value);
10413 __tmp.put_u8(self.ind);
10414 if matches!(version, MavlinkVersion::V2) {
10415 let len = __tmp.len();
10416 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10417 } else {
10418 __tmp.len()
10419 }
10420 }
10421}
10422#[doc = "Large debug/prototyping array. The message uses the maximum available payload for data. The array_id and name fields are used to discriminate between messages in code and in user interfaces (respectively). Do not use in production code."]
10423#[doc = ""]
10424#[doc = "ID: 350"]
10425#[derive(Debug, Clone, PartialEq)]
10426#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10427#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10428#[cfg_attr(feature = "ts", derive(TS))]
10429#[cfg_attr(feature = "ts", ts(export))]
10430pub struct DEBUG_FLOAT_ARRAY_DATA {
10431 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
10432 pub time_usec: u64,
10433 #[doc = "Unique ID used to discriminate between arrays"]
10434 pub array_id: u16,
10435 #[doc = "Name, for human-friendly display in a Ground Control Station"]
10436 #[cfg_attr(feature = "ts", ts(type = "string"))]
10437 pub name: CharArray<10>,
10438 #[doc = "data"]
10439 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10440 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10441 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
10442 pub data: [f32; 58],
10443}
10444impl DEBUG_FLOAT_ARRAY_DATA {
10445 pub const ENCODED_LEN: usize = 252usize;
10446 pub const DEFAULT: Self = Self {
10447 time_usec: 0_u64,
10448 array_id: 0_u16,
10449 name: CharArray::new([0_u8; 10usize]),
10450 data: [0.0_f32; 58usize],
10451 };
10452 #[cfg(feature = "arbitrary")]
10453 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10454 use arbitrary::{Arbitrary, Unstructured};
10455 let mut buf = [0u8; 1024];
10456 rng.fill_bytes(&mut buf);
10457 let mut unstructured = Unstructured::new(&buf);
10458 Self::arbitrary(&mut unstructured).unwrap_or_default()
10459 }
10460}
10461impl Default for DEBUG_FLOAT_ARRAY_DATA {
10462 fn default() -> Self {
10463 Self::DEFAULT.clone()
10464 }
10465}
10466impl MessageData for DEBUG_FLOAT_ARRAY_DATA {
10467 type Message = MavMessage;
10468 const ID: u32 = 350u32;
10469 const NAME: &'static str = "DEBUG_FLOAT_ARRAY";
10470 const EXTRA_CRC: u8 = 232u8;
10471 const ENCODED_LEN: usize = 252usize;
10472 fn deser(
10473 _version: MavlinkVersion,
10474 __input: &[u8],
10475 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10476 let avail_len = __input.len();
10477 let mut payload_buf = [0; Self::ENCODED_LEN];
10478 let mut buf = if avail_len < Self::ENCODED_LEN {
10479 payload_buf[0..avail_len].copy_from_slice(__input);
10480 Bytes::new(&payload_buf)
10481 } else {
10482 Bytes::new(__input)
10483 };
10484 let mut __struct = Self::default();
10485 __struct.time_usec = buf.get_u64_le();
10486 __struct.array_id = buf.get_u16_le();
10487 let mut tmp = [0_u8; 10usize];
10488 for v in &mut tmp {
10489 *v = buf.get_u8();
10490 }
10491 __struct.name = CharArray::new(tmp);
10492 for v in &mut __struct.data {
10493 let val = buf.get_f32_le();
10494 *v = val;
10495 }
10496 Ok(__struct)
10497 }
10498 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10499 let mut __tmp = BytesMut::new(bytes);
10500 #[allow(clippy::absurd_extreme_comparisons)]
10501 #[allow(unused_comparisons)]
10502 if __tmp.remaining() < Self::ENCODED_LEN {
10503 panic!(
10504 "buffer is too small (need {} bytes, but got {})",
10505 Self::ENCODED_LEN,
10506 __tmp.remaining(),
10507 )
10508 }
10509 __tmp.put_u64_le(self.time_usec);
10510 __tmp.put_u16_le(self.array_id);
10511 for val in &self.name {
10512 __tmp.put_u8(*val);
10513 }
10514 if matches!(version, MavlinkVersion::V2) {
10515 for val in &self.data {
10516 __tmp.put_f32_le(*val);
10517 }
10518 let len = __tmp.len();
10519 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10520 } else {
10521 __tmp.len()
10522 }
10523 }
10524}
10525#[doc = "To debug something using a named 3D vector."]
10526#[doc = ""]
10527#[doc = "ID: 250"]
10528#[derive(Debug, Clone, PartialEq)]
10529#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10530#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10531#[cfg_attr(feature = "ts", derive(TS))]
10532#[cfg_attr(feature = "ts", ts(export))]
10533pub struct DEBUG_VECT_DATA {
10534 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
10535 pub time_usec: u64,
10536 #[doc = "x"]
10537 pub x: f32,
10538 #[doc = "y"]
10539 pub y: f32,
10540 #[doc = "z"]
10541 pub z: f32,
10542 #[doc = "Name"]
10543 #[cfg_attr(feature = "ts", ts(type = "string"))]
10544 pub name: CharArray<10>,
10545}
10546impl DEBUG_VECT_DATA {
10547 pub const ENCODED_LEN: usize = 30usize;
10548 pub const DEFAULT: Self = Self {
10549 time_usec: 0_u64,
10550 x: 0.0_f32,
10551 y: 0.0_f32,
10552 z: 0.0_f32,
10553 name: CharArray::new([0_u8; 10usize]),
10554 };
10555 #[cfg(feature = "arbitrary")]
10556 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10557 use arbitrary::{Arbitrary, Unstructured};
10558 let mut buf = [0u8; 1024];
10559 rng.fill_bytes(&mut buf);
10560 let mut unstructured = Unstructured::new(&buf);
10561 Self::arbitrary(&mut unstructured).unwrap_or_default()
10562 }
10563}
10564impl Default for DEBUG_VECT_DATA {
10565 fn default() -> Self {
10566 Self::DEFAULT.clone()
10567 }
10568}
10569impl MessageData for DEBUG_VECT_DATA {
10570 type Message = MavMessage;
10571 const ID: u32 = 250u32;
10572 const NAME: &'static str = "DEBUG_VECT";
10573 const EXTRA_CRC: u8 = 49u8;
10574 const ENCODED_LEN: usize = 30usize;
10575 fn deser(
10576 _version: MavlinkVersion,
10577 __input: &[u8],
10578 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10579 let avail_len = __input.len();
10580 let mut payload_buf = [0; Self::ENCODED_LEN];
10581 let mut buf = if avail_len < Self::ENCODED_LEN {
10582 payload_buf[0..avail_len].copy_from_slice(__input);
10583 Bytes::new(&payload_buf)
10584 } else {
10585 Bytes::new(__input)
10586 };
10587 let mut __struct = Self::default();
10588 __struct.time_usec = buf.get_u64_le();
10589 __struct.x = buf.get_f32_le();
10590 __struct.y = buf.get_f32_le();
10591 __struct.z = buf.get_f32_le();
10592 let mut tmp = [0_u8; 10usize];
10593 for v in &mut tmp {
10594 *v = buf.get_u8();
10595 }
10596 __struct.name = CharArray::new(tmp);
10597 Ok(__struct)
10598 }
10599 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10600 let mut __tmp = BytesMut::new(bytes);
10601 #[allow(clippy::absurd_extreme_comparisons)]
10602 #[allow(unused_comparisons)]
10603 if __tmp.remaining() < Self::ENCODED_LEN {
10604 panic!(
10605 "buffer is too small (need {} bytes, but got {})",
10606 Self::ENCODED_LEN,
10607 __tmp.remaining(),
10608 )
10609 }
10610 __tmp.put_u64_le(self.time_usec);
10611 __tmp.put_f32_le(self.x);
10612 __tmp.put_f32_le(self.y);
10613 __tmp.put_f32_le(self.z);
10614 for val in &self.name {
10615 __tmp.put_u8(*val);
10616 }
10617 if matches!(version, MavlinkVersion::V2) {
10618 let len = __tmp.len();
10619 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10620 } else {
10621 __tmp.len()
10622 }
10623 }
10624}
10625#[doc = "Distance sensor information for an onboard rangefinder."]
10626#[doc = ""]
10627#[doc = "ID: 132"]
10628#[derive(Debug, Clone, PartialEq)]
10629#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10630#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10631#[cfg_attr(feature = "ts", derive(TS))]
10632#[cfg_attr(feature = "ts", ts(export))]
10633pub struct DISTANCE_SENSOR_DATA {
10634 #[doc = "Timestamp (time since system boot)."]
10635 pub time_boot_ms: u32,
10636 #[doc = "Minimum distance the sensor can measure"]
10637 pub min_distance: u16,
10638 #[doc = "Maximum distance the sensor can measure"]
10639 pub max_distance: u16,
10640 #[doc = "Current distance reading"]
10641 pub current_distance: u16,
10642 #[doc = "Type of distance sensor."]
10643 pub mavtype: MavDistanceSensor,
10644 #[doc = "Onboard ID of the sensor"]
10645 pub id: u8,
10646 #[doc = "Direction the sensor faces. downward-facing: ROTATION_PITCH_270, upward-facing: ROTATION_PITCH_90, backward-facing: ROTATION_PITCH_180, forward-facing: ROTATION_NONE, left-facing: ROTATION_YAW_90, right-facing: ROTATION_YAW_270"]
10647 pub orientation: MavSensorOrientation,
10648 #[doc = "Measurement variance. Max standard deviation is 6cm. UINT8_MAX if unknown."]
10649 pub covariance: u8,
10650 #[doc = "Horizontal Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0."]
10651 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10652 pub horizontal_fov: f32,
10653 #[doc = "Vertical Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0."]
10654 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10655 pub vertical_fov: f32,
10656 #[doc = "Quaternion of the sensor orientation in vehicle body frame (w, x, y, z order, zero-rotation is 1, 0, 0, 0). Zero-rotation is along the vehicle body x-axis. This field is required if the orientation is set to MAV_SENSOR_ROTATION_CUSTOM. Set it to 0 if invalid.\""]
10657 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10658 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10659 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
10660 pub quaternion: [f32; 4],
10661 #[doc = "Signal quality of the sensor. Specific to each sensor type, representing the relation of the signal strength with the target reflectivity, distance, size or aspect, but normalised as a percentage. 0 = unknown/unset signal quality, 1 = invalid signal, 100 = perfect signal."]
10662 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10663 pub signal_quality: u8,
10664}
10665impl DISTANCE_SENSOR_DATA {
10666 pub const ENCODED_LEN: usize = 39usize;
10667 pub const DEFAULT: Self = Self {
10668 time_boot_ms: 0_u32,
10669 min_distance: 0_u16,
10670 max_distance: 0_u16,
10671 current_distance: 0_u16,
10672 mavtype: MavDistanceSensor::DEFAULT,
10673 id: 0_u8,
10674 orientation: MavSensorOrientation::DEFAULT,
10675 covariance: 0_u8,
10676 horizontal_fov: 0.0_f32,
10677 vertical_fov: 0.0_f32,
10678 quaternion: [0.0_f32; 4usize],
10679 signal_quality: 0_u8,
10680 };
10681 #[cfg(feature = "arbitrary")]
10682 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10683 use arbitrary::{Arbitrary, Unstructured};
10684 let mut buf = [0u8; 1024];
10685 rng.fill_bytes(&mut buf);
10686 let mut unstructured = Unstructured::new(&buf);
10687 Self::arbitrary(&mut unstructured).unwrap_or_default()
10688 }
10689}
10690impl Default for DISTANCE_SENSOR_DATA {
10691 fn default() -> Self {
10692 Self::DEFAULT.clone()
10693 }
10694}
10695impl MessageData for DISTANCE_SENSOR_DATA {
10696 type Message = MavMessage;
10697 const ID: u32 = 132u32;
10698 const NAME: &'static str = "DISTANCE_SENSOR";
10699 const EXTRA_CRC: u8 = 85u8;
10700 const ENCODED_LEN: usize = 39usize;
10701 fn deser(
10702 _version: MavlinkVersion,
10703 __input: &[u8],
10704 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10705 let avail_len = __input.len();
10706 let mut payload_buf = [0; Self::ENCODED_LEN];
10707 let mut buf = if avail_len < Self::ENCODED_LEN {
10708 payload_buf[0..avail_len].copy_from_slice(__input);
10709 Bytes::new(&payload_buf)
10710 } else {
10711 Bytes::new(__input)
10712 };
10713 let mut __struct = Self::default();
10714 __struct.time_boot_ms = buf.get_u32_le();
10715 __struct.min_distance = buf.get_u16_le();
10716 __struct.max_distance = buf.get_u16_le();
10717 __struct.current_distance = buf.get_u16_le();
10718 let tmp = buf.get_u8();
10719 __struct.mavtype =
10720 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10721 enum_type: "MavDistanceSensor",
10722 value: tmp as u64,
10723 })?;
10724 __struct.id = buf.get_u8();
10725 let tmp = buf.get_u8();
10726 __struct.orientation =
10727 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10728 enum_type: "MavSensorOrientation",
10729 value: tmp as u64,
10730 })?;
10731 __struct.covariance = buf.get_u8();
10732 __struct.horizontal_fov = buf.get_f32_le();
10733 __struct.vertical_fov = buf.get_f32_le();
10734 for v in &mut __struct.quaternion {
10735 let val = buf.get_f32_le();
10736 *v = val;
10737 }
10738 __struct.signal_quality = buf.get_u8();
10739 Ok(__struct)
10740 }
10741 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10742 let mut __tmp = BytesMut::new(bytes);
10743 #[allow(clippy::absurd_extreme_comparisons)]
10744 #[allow(unused_comparisons)]
10745 if __tmp.remaining() < Self::ENCODED_LEN {
10746 panic!(
10747 "buffer is too small (need {} bytes, but got {})",
10748 Self::ENCODED_LEN,
10749 __tmp.remaining(),
10750 )
10751 }
10752 __tmp.put_u32_le(self.time_boot_ms);
10753 __tmp.put_u16_le(self.min_distance);
10754 __tmp.put_u16_le(self.max_distance);
10755 __tmp.put_u16_le(self.current_distance);
10756 __tmp.put_u8(self.mavtype as u8);
10757 __tmp.put_u8(self.id);
10758 __tmp.put_u8(self.orientation as u8);
10759 __tmp.put_u8(self.covariance);
10760 if matches!(version, MavlinkVersion::V2) {
10761 __tmp.put_f32_le(self.horizontal_fov);
10762 __tmp.put_f32_le(self.vertical_fov);
10763 for val in &self.quaternion {
10764 __tmp.put_f32_le(*val);
10765 }
10766 __tmp.put_u8(self.signal_quality);
10767 let len = __tmp.len();
10768 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10769 } else {
10770 __tmp.len()
10771 }
10772 }
10773}
10774#[doc = "EFI status output."]
10775#[doc = ""]
10776#[doc = "ID: 225"]
10777#[derive(Debug, Clone, PartialEq)]
10778#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10779#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10780#[cfg_attr(feature = "ts", derive(TS))]
10781#[cfg_attr(feature = "ts", ts(export))]
10782pub struct EFI_STATUS_DATA {
10783 #[doc = "ECU index"]
10784 pub ecu_index: f32,
10785 #[doc = "RPM"]
10786 pub rpm: f32,
10787 #[doc = "Fuel consumed"]
10788 pub fuel_consumed: f32,
10789 #[doc = "Fuel flow rate"]
10790 pub fuel_flow: f32,
10791 #[doc = "Engine load"]
10792 pub engine_load: f32,
10793 #[doc = "Throttle position"]
10794 pub throttle_position: f32,
10795 #[doc = "Spark dwell time"]
10796 pub spark_dwell_time: f32,
10797 #[doc = "Barometric pressure"]
10798 pub barometric_pressure: f32,
10799 #[doc = "Intake manifold pressure("]
10800 pub intake_manifold_pressure: f32,
10801 #[doc = "Intake manifold temperature"]
10802 pub intake_manifold_temperature: f32,
10803 #[doc = "Cylinder head temperature"]
10804 pub cylinder_head_temperature: f32,
10805 #[doc = "Ignition timing (Crank angle degrees)"]
10806 pub ignition_timing: f32,
10807 #[doc = "Injection time"]
10808 pub injection_time: f32,
10809 #[doc = "Exhaust gas temperature"]
10810 pub exhaust_gas_temperature: f32,
10811 #[doc = "Output throttle"]
10812 pub throttle_out: f32,
10813 #[doc = "Pressure/temperature compensation"]
10814 pub pt_compensation: f32,
10815 #[doc = "EFI health status"]
10816 pub health: u8,
10817 #[doc = "Supply voltage to EFI sparking system. Zero in this value means \"unknown\", so if the supply voltage really is zero volts use 0.0001 instead."]
10818 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10819 pub ignition_voltage: f32,
10820 #[doc = "Fuel pressure. Zero in this value means \"unknown\", so if the fuel pressure really is zero kPa use 0.0001 instead."]
10821 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10822 pub fuel_pressure: f32,
10823}
10824impl EFI_STATUS_DATA {
10825 pub const ENCODED_LEN: usize = 73usize;
10826 pub const DEFAULT: Self = Self {
10827 ecu_index: 0.0_f32,
10828 rpm: 0.0_f32,
10829 fuel_consumed: 0.0_f32,
10830 fuel_flow: 0.0_f32,
10831 engine_load: 0.0_f32,
10832 throttle_position: 0.0_f32,
10833 spark_dwell_time: 0.0_f32,
10834 barometric_pressure: 0.0_f32,
10835 intake_manifold_pressure: 0.0_f32,
10836 intake_manifold_temperature: 0.0_f32,
10837 cylinder_head_temperature: 0.0_f32,
10838 ignition_timing: 0.0_f32,
10839 injection_time: 0.0_f32,
10840 exhaust_gas_temperature: 0.0_f32,
10841 throttle_out: 0.0_f32,
10842 pt_compensation: 0.0_f32,
10843 health: 0_u8,
10844 ignition_voltage: 0.0_f32,
10845 fuel_pressure: 0.0_f32,
10846 };
10847 #[cfg(feature = "arbitrary")]
10848 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10849 use arbitrary::{Arbitrary, Unstructured};
10850 let mut buf = [0u8; 1024];
10851 rng.fill_bytes(&mut buf);
10852 let mut unstructured = Unstructured::new(&buf);
10853 Self::arbitrary(&mut unstructured).unwrap_or_default()
10854 }
10855}
10856impl Default for EFI_STATUS_DATA {
10857 fn default() -> Self {
10858 Self::DEFAULT.clone()
10859 }
10860}
10861impl MessageData for EFI_STATUS_DATA {
10862 type Message = MavMessage;
10863 const ID: u32 = 225u32;
10864 const NAME: &'static str = "EFI_STATUS";
10865 const EXTRA_CRC: u8 = 208u8;
10866 const ENCODED_LEN: usize = 73usize;
10867 fn deser(
10868 _version: MavlinkVersion,
10869 __input: &[u8],
10870 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10871 let avail_len = __input.len();
10872 let mut payload_buf = [0; Self::ENCODED_LEN];
10873 let mut buf = if avail_len < Self::ENCODED_LEN {
10874 payload_buf[0..avail_len].copy_from_slice(__input);
10875 Bytes::new(&payload_buf)
10876 } else {
10877 Bytes::new(__input)
10878 };
10879 let mut __struct = Self::default();
10880 __struct.ecu_index = buf.get_f32_le();
10881 __struct.rpm = buf.get_f32_le();
10882 __struct.fuel_consumed = buf.get_f32_le();
10883 __struct.fuel_flow = buf.get_f32_le();
10884 __struct.engine_load = buf.get_f32_le();
10885 __struct.throttle_position = buf.get_f32_le();
10886 __struct.spark_dwell_time = buf.get_f32_le();
10887 __struct.barometric_pressure = buf.get_f32_le();
10888 __struct.intake_manifold_pressure = buf.get_f32_le();
10889 __struct.intake_manifold_temperature = buf.get_f32_le();
10890 __struct.cylinder_head_temperature = buf.get_f32_le();
10891 __struct.ignition_timing = buf.get_f32_le();
10892 __struct.injection_time = buf.get_f32_le();
10893 __struct.exhaust_gas_temperature = buf.get_f32_le();
10894 __struct.throttle_out = buf.get_f32_le();
10895 __struct.pt_compensation = buf.get_f32_le();
10896 __struct.health = buf.get_u8();
10897 __struct.ignition_voltage = buf.get_f32_le();
10898 __struct.fuel_pressure = buf.get_f32_le();
10899 Ok(__struct)
10900 }
10901 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10902 let mut __tmp = BytesMut::new(bytes);
10903 #[allow(clippy::absurd_extreme_comparisons)]
10904 #[allow(unused_comparisons)]
10905 if __tmp.remaining() < Self::ENCODED_LEN {
10906 panic!(
10907 "buffer is too small (need {} bytes, but got {})",
10908 Self::ENCODED_LEN,
10909 __tmp.remaining(),
10910 )
10911 }
10912 __tmp.put_f32_le(self.ecu_index);
10913 __tmp.put_f32_le(self.rpm);
10914 __tmp.put_f32_le(self.fuel_consumed);
10915 __tmp.put_f32_le(self.fuel_flow);
10916 __tmp.put_f32_le(self.engine_load);
10917 __tmp.put_f32_le(self.throttle_position);
10918 __tmp.put_f32_le(self.spark_dwell_time);
10919 __tmp.put_f32_le(self.barometric_pressure);
10920 __tmp.put_f32_le(self.intake_manifold_pressure);
10921 __tmp.put_f32_le(self.intake_manifold_temperature);
10922 __tmp.put_f32_le(self.cylinder_head_temperature);
10923 __tmp.put_f32_le(self.ignition_timing);
10924 __tmp.put_f32_le(self.injection_time);
10925 __tmp.put_f32_le(self.exhaust_gas_temperature);
10926 __tmp.put_f32_le(self.throttle_out);
10927 __tmp.put_f32_le(self.pt_compensation);
10928 __tmp.put_u8(self.health);
10929 if matches!(version, MavlinkVersion::V2) {
10930 __tmp.put_f32_le(self.ignition_voltage);
10931 __tmp.put_f32_le(self.fuel_pressure);
10932 let len = __tmp.len();
10933 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10934 } else {
10935 __tmp.len()
10936 }
10937 }
10938}
10939#[doc = "Data packet for images sent using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
10940#[doc = ""]
10941#[doc = "ID: 131"]
10942#[derive(Debug, Clone, PartialEq)]
10943#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10944#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10945#[cfg_attr(feature = "ts", derive(TS))]
10946#[cfg_attr(feature = "ts", ts(export))]
10947pub struct ENCAPSULATED_DATA_DATA {
10948 #[doc = "sequence number (starting with 0 on every transmission)"]
10949 pub seqnr: u16,
10950 #[doc = "image data bytes"]
10951 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10952 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
10953 pub data: [u8; 253],
10954}
10955impl ENCAPSULATED_DATA_DATA {
10956 pub const ENCODED_LEN: usize = 255usize;
10957 pub const DEFAULT: Self = Self {
10958 seqnr: 0_u16,
10959 data: [0_u8; 253usize],
10960 };
10961 #[cfg(feature = "arbitrary")]
10962 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10963 use arbitrary::{Arbitrary, Unstructured};
10964 let mut buf = [0u8; 1024];
10965 rng.fill_bytes(&mut buf);
10966 let mut unstructured = Unstructured::new(&buf);
10967 Self::arbitrary(&mut unstructured).unwrap_or_default()
10968 }
10969}
10970impl Default for ENCAPSULATED_DATA_DATA {
10971 fn default() -> Self {
10972 Self::DEFAULT.clone()
10973 }
10974}
10975impl MessageData for ENCAPSULATED_DATA_DATA {
10976 type Message = MavMessage;
10977 const ID: u32 = 131u32;
10978 const NAME: &'static str = "ENCAPSULATED_DATA";
10979 const EXTRA_CRC: u8 = 223u8;
10980 const ENCODED_LEN: usize = 255usize;
10981 fn deser(
10982 _version: MavlinkVersion,
10983 __input: &[u8],
10984 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10985 let avail_len = __input.len();
10986 let mut payload_buf = [0; Self::ENCODED_LEN];
10987 let mut buf = if avail_len < Self::ENCODED_LEN {
10988 payload_buf[0..avail_len].copy_from_slice(__input);
10989 Bytes::new(&payload_buf)
10990 } else {
10991 Bytes::new(__input)
10992 };
10993 let mut __struct = Self::default();
10994 __struct.seqnr = buf.get_u16_le();
10995 for v in &mut __struct.data {
10996 let val = buf.get_u8();
10997 *v = val;
10998 }
10999 Ok(__struct)
11000 }
11001 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11002 let mut __tmp = BytesMut::new(bytes);
11003 #[allow(clippy::absurd_extreme_comparisons)]
11004 #[allow(unused_comparisons)]
11005 if __tmp.remaining() < Self::ENCODED_LEN {
11006 panic!(
11007 "buffer is too small (need {} bytes, but got {})",
11008 Self::ENCODED_LEN,
11009 __tmp.remaining(),
11010 )
11011 }
11012 __tmp.put_u16_le(self.seqnr);
11013 for val in &self.data {
11014 __tmp.put_u8(*val);
11015 }
11016 if matches!(version, MavlinkVersion::V2) {
11017 let len = __tmp.len();
11018 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11019 } else {
11020 __tmp.len()
11021 }
11022 }
11023}
11024#[doc = "ESC information for lower rate streaming. Recommended streaming rate 1Hz. See ESC_STATUS for higher-rate ESC data."]
11025#[doc = ""]
11026#[doc = "ID: 290"]
11027#[derive(Debug, Clone, PartialEq)]
11028#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11029#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11030#[cfg_attr(feature = "ts", derive(TS))]
11031#[cfg_attr(feature = "ts", ts(export))]
11032pub struct ESC_INFO_DATA {
11033 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number."]
11034 pub time_usec: u64,
11035 #[doc = "Number of reported errors by each ESC since boot."]
11036 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11037 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11038 pub error_count: [u32; 4],
11039 #[doc = "Counter of data packets received."]
11040 pub counter: u16,
11041 #[doc = "Bitmap of ESC failure flags."]
11042 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11043 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11044 pub failure_flags: [u16; 4],
11045 #[doc = "Temperature of each ESC. INT16_MAX: if data not supplied by ESC."]
11046 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11047 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11048 pub temperature: [i16; 4],
11049 #[doc = "Index of the first ESC in this message. minValue = 0, maxValue = 60, increment = 4."]
11050 pub index: u8,
11051 #[doc = "Total number of ESCs in all messages of this type. Message fields with an index higher than this should be ignored because they contain invalid data."]
11052 pub count: u8,
11053 #[doc = "Connection type protocol for all ESC."]
11054 pub connection_type: EscConnectionType,
11055 #[doc = "Information regarding online/offline status of each ESC."]
11056 pub info: u8,
11057}
11058impl ESC_INFO_DATA {
11059 pub const ENCODED_LEN: usize = 46usize;
11060 pub const DEFAULT: Self = Self {
11061 time_usec: 0_u64,
11062 error_count: [0_u32; 4usize],
11063 counter: 0_u16,
11064 failure_flags: [0_u16; 4usize],
11065 temperature: [0_i16; 4usize],
11066 index: 0_u8,
11067 count: 0_u8,
11068 connection_type: EscConnectionType::DEFAULT,
11069 info: 0_u8,
11070 };
11071 #[cfg(feature = "arbitrary")]
11072 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11073 use arbitrary::{Arbitrary, Unstructured};
11074 let mut buf = [0u8; 1024];
11075 rng.fill_bytes(&mut buf);
11076 let mut unstructured = Unstructured::new(&buf);
11077 Self::arbitrary(&mut unstructured).unwrap_or_default()
11078 }
11079}
11080impl Default for ESC_INFO_DATA {
11081 fn default() -> Self {
11082 Self::DEFAULT.clone()
11083 }
11084}
11085impl MessageData for ESC_INFO_DATA {
11086 type Message = MavMessage;
11087 const ID: u32 = 290u32;
11088 const NAME: &'static str = "ESC_INFO";
11089 const EXTRA_CRC: u8 = 251u8;
11090 const ENCODED_LEN: usize = 46usize;
11091 fn deser(
11092 _version: MavlinkVersion,
11093 __input: &[u8],
11094 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11095 let avail_len = __input.len();
11096 let mut payload_buf = [0; Self::ENCODED_LEN];
11097 let mut buf = if avail_len < Self::ENCODED_LEN {
11098 payload_buf[0..avail_len].copy_from_slice(__input);
11099 Bytes::new(&payload_buf)
11100 } else {
11101 Bytes::new(__input)
11102 };
11103 let mut __struct = Self::default();
11104 __struct.time_usec = buf.get_u64_le();
11105 for v in &mut __struct.error_count {
11106 let val = buf.get_u32_le();
11107 *v = val;
11108 }
11109 __struct.counter = buf.get_u16_le();
11110 for v in &mut __struct.failure_flags {
11111 let val = buf.get_u16_le();
11112 *v = val;
11113 }
11114 for v in &mut __struct.temperature {
11115 let val = buf.get_i16_le();
11116 *v = val;
11117 }
11118 __struct.index = buf.get_u8();
11119 __struct.count = buf.get_u8();
11120 let tmp = buf.get_u8();
11121 __struct.connection_type =
11122 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11123 enum_type: "EscConnectionType",
11124 value: tmp as u64,
11125 })?;
11126 __struct.info = buf.get_u8();
11127 Ok(__struct)
11128 }
11129 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11130 let mut __tmp = BytesMut::new(bytes);
11131 #[allow(clippy::absurd_extreme_comparisons)]
11132 #[allow(unused_comparisons)]
11133 if __tmp.remaining() < Self::ENCODED_LEN {
11134 panic!(
11135 "buffer is too small (need {} bytes, but got {})",
11136 Self::ENCODED_LEN,
11137 __tmp.remaining(),
11138 )
11139 }
11140 __tmp.put_u64_le(self.time_usec);
11141 for val in &self.error_count {
11142 __tmp.put_u32_le(*val);
11143 }
11144 __tmp.put_u16_le(self.counter);
11145 for val in &self.failure_flags {
11146 __tmp.put_u16_le(*val);
11147 }
11148 for val in &self.temperature {
11149 __tmp.put_i16_le(*val);
11150 }
11151 __tmp.put_u8(self.index);
11152 __tmp.put_u8(self.count);
11153 __tmp.put_u8(self.connection_type as u8);
11154 __tmp.put_u8(self.info);
11155 if matches!(version, MavlinkVersion::V2) {
11156 let len = __tmp.len();
11157 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11158 } else {
11159 __tmp.len()
11160 }
11161 }
11162}
11163#[doc = "ESC information for higher rate streaming. Recommended streaming rate is ~10 Hz. Information that changes more slowly is sent in ESC_INFO. It should typically only be streamed on high-bandwidth links (i.e. to a companion computer)."]
11164#[doc = ""]
11165#[doc = "ID: 291"]
11166#[derive(Debug, Clone, PartialEq)]
11167#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11168#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11169#[cfg_attr(feature = "ts", derive(TS))]
11170#[cfg_attr(feature = "ts", ts(export))]
11171pub struct ESC_STATUS_DATA {
11172 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number."]
11173 pub time_usec: u64,
11174 #[doc = "Reported motor RPM from each ESC (negative for reverse rotation)."]
11175 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11176 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11177 pub rpm: [i32; 4],
11178 #[doc = "Voltage measured from each ESC."]
11179 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11180 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11181 pub voltage: [f32; 4],
11182 #[doc = "Current measured from each ESC."]
11183 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11184 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11185 pub current: [f32; 4],
11186 #[doc = "Index of the first ESC in this message. minValue = 0, maxValue = 60, increment = 4."]
11187 pub index: u8,
11188}
11189impl ESC_STATUS_DATA {
11190 pub const ENCODED_LEN: usize = 57usize;
11191 pub const DEFAULT: Self = Self {
11192 time_usec: 0_u64,
11193 rpm: [0_i32; 4usize],
11194 voltage: [0.0_f32; 4usize],
11195 current: [0.0_f32; 4usize],
11196 index: 0_u8,
11197 };
11198 #[cfg(feature = "arbitrary")]
11199 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11200 use arbitrary::{Arbitrary, Unstructured};
11201 let mut buf = [0u8; 1024];
11202 rng.fill_bytes(&mut buf);
11203 let mut unstructured = Unstructured::new(&buf);
11204 Self::arbitrary(&mut unstructured).unwrap_or_default()
11205 }
11206}
11207impl Default for ESC_STATUS_DATA {
11208 fn default() -> Self {
11209 Self::DEFAULT.clone()
11210 }
11211}
11212impl MessageData for ESC_STATUS_DATA {
11213 type Message = MavMessage;
11214 const ID: u32 = 291u32;
11215 const NAME: &'static str = "ESC_STATUS";
11216 const EXTRA_CRC: u8 = 10u8;
11217 const ENCODED_LEN: usize = 57usize;
11218 fn deser(
11219 _version: MavlinkVersion,
11220 __input: &[u8],
11221 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11222 let avail_len = __input.len();
11223 let mut payload_buf = [0; Self::ENCODED_LEN];
11224 let mut buf = if avail_len < Self::ENCODED_LEN {
11225 payload_buf[0..avail_len].copy_from_slice(__input);
11226 Bytes::new(&payload_buf)
11227 } else {
11228 Bytes::new(__input)
11229 };
11230 let mut __struct = Self::default();
11231 __struct.time_usec = buf.get_u64_le();
11232 for v in &mut __struct.rpm {
11233 let val = buf.get_i32_le();
11234 *v = val;
11235 }
11236 for v in &mut __struct.voltage {
11237 let val = buf.get_f32_le();
11238 *v = val;
11239 }
11240 for v in &mut __struct.current {
11241 let val = buf.get_f32_le();
11242 *v = val;
11243 }
11244 __struct.index = buf.get_u8();
11245 Ok(__struct)
11246 }
11247 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11248 let mut __tmp = BytesMut::new(bytes);
11249 #[allow(clippy::absurd_extreme_comparisons)]
11250 #[allow(unused_comparisons)]
11251 if __tmp.remaining() < Self::ENCODED_LEN {
11252 panic!(
11253 "buffer is too small (need {} bytes, but got {})",
11254 Self::ENCODED_LEN,
11255 __tmp.remaining(),
11256 )
11257 }
11258 __tmp.put_u64_le(self.time_usec);
11259 for val in &self.rpm {
11260 __tmp.put_i32_le(*val);
11261 }
11262 for val in &self.voltage {
11263 __tmp.put_f32_le(*val);
11264 }
11265 for val in &self.current {
11266 __tmp.put_f32_le(*val);
11267 }
11268 __tmp.put_u8(self.index);
11269 if matches!(version, MavlinkVersion::V2) {
11270 let len = __tmp.len();
11271 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11272 } else {
11273 __tmp.len()
11274 }
11275 }
11276}
11277#[doc = "Estimator status message including flags, innovation test ratios and estimated accuracies. The flags message is an integer bitmask containing information on which EKF outputs are valid. See the ESTIMATOR_STATUS_FLAGS enum definition for further information. The innovation test ratios show the magnitude of the sensor innovation divided by the innovation check threshold. Under normal operation the innovation test ratios should be below 0.5 with occasional values up to 1.0. Values greater than 1.0 should be rare under normal operation and indicate that a measurement has been rejected by the filter. The user should be notified if an innovation test ratio greater than 1.0 is recorded. Notifications for values in the range between 0.5 and 1.0 should be optional and controllable by the user."]
11278#[doc = ""]
11279#[doc = "ID: 230"]
11280#[derive(Debug, Clone, PartialEq)]
11281#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11282#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11283#[cfg_attr(feature = "ts", derive(TS))]
11284#[cfg_attr(feature = "ts", ts(export))]
11285pub struct ESTIMATOR_STATUS_DATA {
11286 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
11287 pub time_usec: u64,
11288 #[doc = "Velocity innovation test ratio"]
11289 pub vel_ratio: f32,
11290 #[doc = "Horizontal position innovation test ratio"]
11291 pub pos_horiz_ratio: f32,
11292 #[doc = "Vertical position innovation test ratio"]
11293 pub pos_vert_ratio: f32,
11294 #[doc = "Magnetometer innovation test ratio"]
11295 pub mag_ratio: f32,
11296 #[doc = "Height above terrain innovation test ratio"]
11297 pub hagl_ratio: f32,
11298 #[doc = "True airspeed innovation test ratio"]
11299 pub tas_ratio: f32,
11300 #[doc = "Horizontal position 1-STD accuracy relative to the EKF local origin"]
11301 pub pos_horiz_accuracy: f32,
11302 #[doc = "Vertical position 1-STD accuracy relative to the EKF local origin"]
11303 pub pos_vert_accuracy: f32,
11304 #[doc = "Bitmap indicating which EKF outputs are valid."]
11305 pub flags: EstimatorStatusFlags,
11306}
11307impl ESTIMATOR_STATUS_DATA {
11308 pub const ENCODED_LEN: usize = 42usize;
11309 pub const DEFAULT: Self = Self {
11310 time_usec: 0_u64,
11311 vel_ratio: 0.0_f32,
11312 pos_horiz_ratio: 0.0_f32,
11313 pos_vert_ratio: 0.0_f32,
11314 mag_ratio: 0.0_f32,
11315 hagl_ratio: 0.0_f32,
11316 tas_ratio: 0.0_f32,
11317 pos_horiz_accuracy: 0.0_f32,
11318 pos_vert_accuracy: 0.0_f32,
11319 flags: EstimatorStatusFlags::DEFAULT,
11320 };
11321 #[cfg(feature = "arbitrary")]
11322 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11323 use arbitrary::{Arbitrary, Unstructured};
11324 let mut buf = [0u8; 1024];
11325 rng.fill_bytes(&mut buf);
11326 let mut unstructured = Unstructured::new(&buf);
11327 Self::arbitrary(&mut unstructured).unwrap_or_default()
11328 }
11329}
11330impl Default for ESTIMATOR_STATUS_DATA {
11331 fn default() -> Self {
11332 Self::DEFAULT.clone()
11333 }
11334}
11335impl MessageData for ESTIMATOR_STATUS_DATA {
11336 type Message = MavMessage;
11337 const ID: u32 = 230u32;
11338 const NAME: &'static str = "ESTIMATOR_STATUS";
11339 const EXTRA_CRC: u8 = 163u8;
11340 const ENCODED_LEN: usize = 42usize;
11341 fn deser(
11342 _version: MavlinkVersion,
11343 __input: &[u8],
11344 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11345 let avail_len = __input.len();
11346 let mut payload_buf = [0; Self::ENCODED_LEN];
11347 let mut buf = if avail_len < Self::ENCODED_LEN {
11348 payload_buf[0..avail_len].copy_from_slice(__input);
11349 Bytes::new(&payload_buf)
11350 } else {
11351 Bytes::new(__input)
11352 };
11353 let mut __struct = Self::default();
11354 __struct.time_usec = buf.get_u64_le();
11355 __struct.vel_ratio = buf.get_f32_le();
11356 __struct.pos_horiz_ratio = buf.get_f32_le();
11357 __struct.pos_vert_ratio = buf.get_f32_le();
11358 __struct.mag_ratio = buf.get_f32_le();
11359 __struct.hagl_ratio = buf.get_f32_le();
11360 __struct.tas_ratio = buf.get_f32_le();
11361 __struct.pos_horiz_accuracy = buf.get_f32_le();
11362 __struct.pos_vert_accuracy = buf.get_f32_le();
11363 let tmp = buf.get_u16_le();
11364 __struct.flags = EstimatorStatusFlags::from_bits(tmp).ok_or(
11365 ::mavlink_core::error::ParserError::InvalidFlag {
11366 flag_type: "EstimatorStatusFlags",
11367 value: tmp as u64,
11368 },
11369 )?;
11370 Ok(__struct)
11371 }
11372 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11373 let mut __tmp = BytesMut::new(bytes);
11374 #[allow(clippy::absurd_extreme_comparisons)]
11375 #[allow(unused_comparisons)]
11376 if __tmp.remaining() < Self::ENCODED_LEN {
11377 panic!(
11378 "buffer is too small (need {} bytes, but got {})",
11379 Self::ENCODED_LEN,
11380 __tmp.remaining(),
11381 )
11382 }
11383 __tmp.put_u64_le(self.time_usec);
11384 __tmp.put_f32_le(self.vel_ratio);
11385 __tmp.put_f32_le(self.pos_horiz_ratio);
11386 __tmp.put_f32_le(self.pos_vert_ratio);
11387 __tmp.put_f32_le(self.mag_ratio);
11388 __tmp.put_f32_le(self.hagl_ratio);
11389 __tmp.put_f32_le(self.tas_ratio);
11390 __tmp.put_f32_le(self.pos_horiz_accuracy);
11391 __tmp.put_f32_le(self.pos_vert_accuracy);
11392 __tmp.put_u16_le(self.flags.bits());
11393 if matches!(version, MavlinkVersion::V2) {
11394 let len = __tmp.len();
11395 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11396 } else {
11397 __tmp.len()
11398 }
11399 }
11400}
11401#[doc = "Event message. Each new event from a particular component gets a new sequence number. The same message might be sent multiple times if (re-)requested. Most events are broadcast, some can be specific to a target component (as receivers keep track of the sequence for missed events, all events need to be broadcast. Thus we use destination_component instead of target_component)."]
11402#[doc = ""]
11403#[doc = "ID: 410"]
11404#[derive(Debug, Clone, PartialEq)]
11405#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11406#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11407#[cfg_attr(feature = "ts", derive(TS))]
11408#[cfg_attr(feature = "ts", ts(export))]
11409pub struct EVENT_DATA {
11410 #[doc = "Event ID (as defined in the component metadata)"]
11411 pub id: u32,
11412 #[doc = "Timestamp (time since system boot when the event happened)."]
11413 pub event_time_boot_ms: u32,
11414 #[doc = "Sequence number."]
11415 pub sequence: u16,
11416 #[doc = "Component ID"]
11417 pub destination_component: u8,
11418 #[doc = "System ID"]
11419 pub destination_system: u8,
11420 #[doc = "Log levels: 4 bits MSB: internal (for logging purposes), 4 bits LSB: external. Levels: Emergency = 0, Alert = 1, Critical = 2, Error = 3, Warning = 4, Notice = 5, Info = 6, Debug = 7, Protocol = 8, Disabled = 9"]
11421 pub log_levels: u8,
11422 #[doc = "Arguments (depend on event ID)."]
11423 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11424 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11425 pub arguments: [u8; 40],
11426}
11427impl EVENT_DATA {
11428 pub const ENCODED_LEN: usize = 53usize;
11429 pub const DEFAULT: Self = Self {
11430 id: 0_u32,
11431 event_time_boot_ms: 0_u32,
11432 sequence: 0_u16,
11433 destination_component: 0_u8,
11434 destination_system: 0_u8,
11435 log_levels: 0_u8,
11436 arguments: [0_u8; 40usize],
11437 };
11438 #[cfg(feature = "arbitrary")]
11439 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11440 use arbitrary::{Arbitrary, Unstructured};
11441 let mut buf = [0u8; 1024];
11442 rng.fill_bytes(&mut buf);
11443 let mut unstructured = Unstructured::new(&buf);
11444 Self::arbitrary(&mut unstructured).unwrap_or_default()
11445 }
11446}
11447impl Default for EVENT_DATA {
11448 fn default() -> Self {
11449 Self::DEFAULT.clone()
11450 }
11451}
11452impl MessageData for EVENT_DATA {
11453 type Message = MavMessage;
11454 const ID: u32 = 410u32;
11455 const NAME: &'static str = "EVENT";
11456 const EXTRA_CRC: u8 = 160u8;
11457 const ENCODED_LEN: usize = 53usize;
11458 fn deser(
11459 _version: MavlinkVersion,
11460 __input: &[u8],
11461 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11462 let avail_len = __input.len();
11463 let mut payload_buf = [0; Self::ENCODED_LEN];
11464 let mut buf = if avail_len < Self::ENCODED_LEN {
11465 payload_buf[0..avail_len].copy_from_slice(__input);
11466 Bytes::new(&payload_buf)
11467 } else {
11468 Bytes::new(__input)
11469 };
11470 let mut __struct = Self::default();
11471 __struct.id = buf.get_u32_le();
11472 __struct.event_time_boot_ms = buf.get_u32_le();
11473 __struct.sequence = buf.get_u16_le();
11474 __struct.destination_component = buf.get_u8();
11475 __struct.destination_system = buf.get_u8();
11476 __struct.log_levels = buf.get_u8();
11477 for v in &mut __struct.arguments {
11478 let val = buf.get_u8();
11479 *v = val;
11480 }
11481 Ok(__struct)
11482 }
11483 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11484 let mut __tmp = BytesMut::new(bytes);
11485 #[allow(clippy::absurd_extreme_comparisons)]
11486 #[allow(unused_comparisons)]
11487 if __tmp.remaining() < Self::ENCODED_LEN {
11488 panic!(
11489 "buffer is too small (need {} bytes, but got {})",
11490 Self::ENCODED_LEN,
11491 __tmp.remaining(),
11492 )
11493 }
11494 __tmp.put_u32_le(self.id);
11495 __tmp.put_u32_le(self.event_time_boot_ms);
11496 __tmp.put_u16_le(self.sequence);
11497 __tmp.put_u8(self.destination_component);
11498 __tmp.put_u8(self.destination_system);
11499 __tmp.put_u8(self.log_levels);
11500 for val in &self.arguments {
11501 __tmp.put_u8(*val);
11502 }
11503 if matches!(version, MavlinkVersion::V2) {
11504 let len = __tmp.len();
11505 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11506 } else {
11507 __tmp.len()
11508 }
11509 }
11510}
11511#[doc = "Provides state for additional features."]
11512#[doc = ""]
11513#[doc = "ID: 245"]
11514#[derive(Debug, Clone, PartialEq)]
11515#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11516#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11517#[cfg_attr(feature = "ts", derive(TS))]
11518#[cfg_attr(feature = "ts", ts(export))]
11519pub struct EXTENDED_SYS_STATE_DATA {
11520 #[doc = "The VTOL state if applicable. Is set to MAV_VTOL_STATE_UNDEFINED if UAV is not in VTOL configuration."]
11521 pub vtol_state: MavVtolState,
11522 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
11523 pub landed_state: MavLandedState,
11524}
11525impl EXTENDED_SYS_STATE_DATA {
11526 pub const ENCODED_LEN: usize = 2usize;
11527 pub const DEFAULT: Self = Self {
11528 vtol_state: MavVtolState::DEFAULT,
11529 landed_state: MavLandedState::DEFAULT,
11530 };
11531 #[cfg(feature = "arbitrary")]
11532 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11533 use arbitrary::{Arbitrary, Unstructured};
11534 let mut buf = [0u8; 1024];
11535 rng.fill_bytes(&mut buf);
11536 let mut unstructured = Unstructured::new(&buf);
11537 Self::arbitrary(&mut unstructured).unwrap_or_default()
11538 }
11539}
11540impl Default for EXTENDED_SYS_STATE_DATA {
11541 fn default() -> Self {
11542 Self::DEFAULT.clone()
11543 }
11544}
11545impl MessageData for EXTENDED_SYS_STATE_DATA {
11546 type Message = MavMessage;
11547 const ID: u32 = 245u32;
11548 const NAME: &'static str = "EXTENDED_SYS_STATE";
11549 const EXTRA_CRC: u8 = 130u8;
11550 const ENCODED_LEN: usize = 2usize;
11551 fn deser(
11552 _version: MavlinkVersion,
11553 __input: &[u8],
11554 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11555 let avail_len = __input.len();
11556 let mut payload_buf = [0; Self::ENCODED_LEN];
11557 let mut buf = if avail_len < Self::ENCODED_LEN {
11558 payload_buf[0..avail_len].copy_from_slice(__input);
11559 Bytes::new(&payload_buf)
11560 } else {
11561 Bytes::new(__input)
11562 };
11563 let mut __struct = Self::default();
11564 let tmp = buf.get_u8();
11565 __struct.vtol_state =
11566 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11567 enum_type: "MavVtolState",
11568 value: tmp as u64,
11569 })?;
11570 let tmp = buf.get_u8();
11571 __struct.landed_state =
11572 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11573 enum_type: "MavLandedState",
11574 value: tmp as u64,
11575 })?;
11576 Ok(__struct)
11577 }
11578 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11579 let mut __tmp = BytesMut::new(bytes);
11580 #[allow(clippy::absurd_extreme_comparisons)]
11581 #[allow(unused_comparisons)]
11582 if __tmp.remaining() < Self::ENCODED_LEN {
11583 panic!(
11584 "buffer is too small (need {} bytes, but got {})",
11585 Self::ENCODED_LEN,
11586 __tmp.remaining(),
11587 )
11588 }
11589 __tmp.put_u8(self.vtol_state as u8);
11590 __tmp.put_u8(self.landed_state as u8);
11591 if matches!(version, MavlinkVersion::V2) {
11592 let len = __tmp.len();
11593 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11594 } else {
11595 __tmp.len()
11596 }
11597 }
11598}
11599#[doc = "Status of geo-fencing. Sent in extended status stream when fencing enabled."]
11600#[doc = ""]
11601#[doc = "ID: 162"]
11602#[derive(Debug, Clone, PartialEq)]
11603#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11604#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11605#[cfg_attr(feature = "ts", derive(TS))]
11606#[cfg_attr(feature = "ts", ts(export))]
11607pub struct FENCE_STATUS_DATA {
11608 #[doc = "Time (since boot) of last breach."]
11609 pub breach_time: u32,
11610 #[doc = "Number of fence breaches."]
11611 pub breach_count: u16,
11612 #[doc = "Breach status (0 if currently inside fence, 1 if outside)."]
11613 pub breach_status: u8,
11614 #[doc = "Last breach type."]
11615 pub breach_type: FenceBreach,
11616 #[doc = "Active action to prevent fence breach"]
11617 #[cfg_attr(feature = "serde", serde(default))]
11618 pub breach_mitigation: FenceMitigate,
11619}
11620impl FENCE_STATUS_DATA {
11621 pub const ENCODED_LEN: usize = 9usize;
11622 pub const DEFAULT: Self = Self {
11623 breach_time: 0_u32,
11624 breach_count: 0_u16,
11625 breach_status: 0_u8,
11626 breach_type: FenceBreach::DEFAULT,
11627 breach_mitigation: FenceMitigate::DEFAULT,
11628 };
11629 #[cfg(feature = "arbitrary")]
11630 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11631 use arbitrary::{Arbitrary, Unstructured};
11632 let mut buf = [0u8; 1024];
11633 rng.fill_bytes(&mut buf);
11634 let mut unstructured = Unstructured::new(&buf);
11635 Self::arbitrary(&mut unstructured).unwrap_or_default()
11636 }
11637}
11638impl Default for FENCE_STATUS_DATA {
11639 fn default() -> Self {
11640 Self::DEFAULT.clone()
11641 }
11642}
11643impl MessageData for FENCE_STATUS_DATA {
11644 type Message = MavMessage;
11645 const ID: u32 = 162u32;
11646 const NAME: &'static str = "FENCE_STATUS";
11647 const EXTRA_CRC: u8 = 189u8;
11648 const ENCODED_LEN: usize = 9usize;
11649 fn deser(
11650 _version: MavlinkVersion,
11651 __input: &[u8],
11652 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11653 let avail_len = __input.len();
11654 let mut payload_buf = [0; Self::ENCODED_LEN];
11655 let mut buf = if avail_len < Self::ENCODED_LEN {
11656 payload_buf[0..avail_len].copy_from_slice(__input);
11657 Bytes::new(&payload_buf)
11658 } else {
11659 Bytes::new(__input)
11660 };
11661 let mut __struct = Self::default();
11662 __struct.breach_time = buf.get_u32_le();
11663 __struct.breach_count = buf.get_u16_le();
11664 __struct.breach_status = buf.get_u8();
11665 let tmp = buf.get_u8();
11666 __struct.breach_type =
11667 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11668 enum_type: "FenceBreach",
11669 value: tmp as u64,
11670 })?;
11671 let tmp = buf.get_u8();
11672 __struct.breach_mitigation =
11673 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11674 enum_type: "FenceMitigate",
11675 value: tmp as u64,
11676 })?;
11677 Ok(__struct)
11678 }
11679 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11680 let mut __tmp = BytesMut::new(bytes);
11681 #[allow(clippy::absurd_extreme_comparisons)]
11682 #[allow(unused_comparisons)]
11683 if __tmp.remaining() < Self::ENCODED_LEN {
11684 panic!(
11685 "buffer is too small (need {} bytes, but got {})",
11686 Self::ENCODED_LEN,
11687 __tmp.remaining(),
11688 )
11689 }
11690 __tmp.put_u32_le(self.breach_time);
11691 __tmp.put_u16_le(self.breach_count);
11692 __tmp.put_u8(self.breach_status);
11693 __tmp.put_u8(self.breach_type as u8);
11694 if matches!(version, MavlinkVersion::V2) {
11695 __tmp.put_u8(self.breach_mitigation as u8);
11696 let len = __tmp.len();
11697 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11698 } else {
11699 __tmp.len()
11700 }
11701 }
11702}
11703#[doc = "File transfer protocol message: <https://mavlink.io/en/services/ftp.html>."]
11704#[doc = ""]
11705#[doc = "ID: 110"]
11706#[derive(Debug, Clone, PartialEq)]
11707#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11708#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11709#[cfg_attr(feature = "ts", derive(TS))]
11710#[cfg_attr(feature = "ts", ts(export))]
11711pub struct FILE_TRANSFER_PROTOCOL_DATA {
11712 #[doc = "Network ID (0 for broadcast)"]
11713 pub target_network: u8,
11714 #[doc = "System ID (0 for broadcast)"]
11715 pub target_system: u8,
11716 #[doc = "Component ID (0 for broadcast)"]
11717 pub target_component: u8,
11718 #[doc = "Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields. The content/format of this block is defined in <https://mavlink.io/en/services/ftp.html>."]
11719 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11720 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11721 pub payload: [u8; 251],
11722}
11723impl FILE_TRANSFER_PROTOCOL_DATA {
11724 pub const ENCODED_LEN: usize = 254usize;
11725 pub const DEFAULT: Self = Self {
11726 target_network: 0_u8,
11727 target_system: 0_u8,
11728 target_component: 0_u8,
11729 payload: [0_u8; 251usize],
11730 };
11731 #[cfg(feature = "arbitrary")]
11732 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11733 use arbitrary::{Arbitrary, Unstructured};
11734 let mut buf = [0u8; 1024];
11735 rng.fill_bytes(&mut buf);
11736 let mut unstructured = Unstructured::new(&buf);
11737 Self::arbitrary(&mut unstructured).unwrap_or_default()
11738 }
11739}
11740impl Default for FILE_TRANSFER_PROTOCOL_DATA {
11741 fn default() -> Self {
11742 Self::DEFAULT.clone()
11743 }
11744}
11745impl MessageData for FILE_TRANSFER_PROTOCOL_DATA {
11746 type Message = MavMessage;
11747 const ID: u32 = 110u32;
11748 const NAME: &'static str = "FILE_TRANSFER_PROTOCOL";
11749 const EXTRA_CRC: u8 = 84u8;
11750 const ENCODED_LEN: usize = 254usize;
11751 fn deser(
11752 _version: MavlinkVersion,
11753 __input: &[u8],
11754 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11755 let avail_len = __input.len();
11756 let mut payload_buf = [0; Self::ENCODED_LEN];
11757 let mut buf = if avail_len < Self::ENCODED_LEN {
11758 payload_buf[0..avail_len].copy_from_slice(__input);
11759 Bytes::new(&payload_buf)
11760 } else {
11761 Bytes::new(__input)
11762 };
11763 let mut __struct = Self::default();
11764 __struct.target_network = buf.get_u8();
11765 __struct.target_system = buf.get_u8();
11766 __struct.target_component = buf.get_u8();
11767 for v in &mut __struct.payload {
11768 let val = buf.get_u8();
11769 *v = val;
11770 }
11771 Ok(__struct)
11772 }
11773 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11774 let mut __tmp = BytesMut::new(bytes);
11775 #[allow(clippy::absurd_extreme_comparisons)]
11776 #[allow(unused_comparisons)]
11777 if __tmp.remaining() < Self::ENCODED_LEN {
11778 panic!(
11779 "buffer is too small (need {} bytes, but got {})",
11780 Self::ENCODED_LEN,
11781 __tmp.remaining(),
11782 )
11783 }
11784 __tmp.put_u8(self.target_network);
11785 __tmp.put_u8(self.target_system);
11786 __tmp.put_u8(self.target_component);
11787 for val in &self.payload {
11788 __tmp.put_u8(*val);
11789 }
11790 if matches!(version, MavlinkVersion::V2) {
11791 let len = __tmp.len();
11792 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11793 } else {
11794 __tmp.len()
11795 }
11796 }
11797}
11798#[doc = "Flight information. This includes time since boot for arm, takeoff, and land, and a flight number. Takeoff and landing values reset to zero on arm. This can be requested using MAV_CMD_REQUEST_MESSAGE. Note, some fields are misnamed - timestamps are from boot (not UTC) and the flight_uuid is a sequence number."]
11799#[doc = ""]
11800#[doc = "ID: 264"]
11801#[derive(Debug, Clone, PartialEq)]
11802#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11803#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11804#[cfg_attr(feature = "ts", derive(TS))]
11805#[cfg_attr(feature = "ts", ts(export))]
11806pub struct FLIGHT_INFORMATION_DATA {
11807 #[doc = "Timestamp at arming (since system boot). Set to 0 on boot. Set value on arming. Note, field is misnamed UTC."]
11808 pub arming_time_utc: u64,
11809 #[doc = "Timestamp at takeoff (since system boot). Set to 0 at boot and on arming. Note, field is misnamed UTC."]
11810 pub takeoff_time_utc: u64,
11811 #[doc = "Flight number. Note, field is misnamed UUID."]
11812 pub flight_uuid: u64,
11813 #[doc = "Timestamp (time since system boot)."]
11814 pub time_boot_ms: u32,
11815 #[doc = "Timestamp at landing (in ms since system boot). Set to 0 at boot and on arming."]
11816 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11817 pub landing_time: u32,
11818}
11819impl FLIGHT_INFORMATION_DATA {
11820 pub const ENCODED_LEN: usize = 32usize;
11821 pub const DEFAULT: Self = Self {
11822 arming_time_utc: 0_u64,
11823 takeoff_time_utc: 0_u64,
11824 flight_uuid: 0_u64,
11825 time_boot_ms: 0_u32,
11826 landing_time: 0_u32,
11827 };
11828 #[cfg(feature = "arbitrary")]
11829 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11830 use arbitrary::{Arbitrary, Unstructured};
11831 let mut buf = [0u8; 1024];
11832 rng.fill_bytes(&mut buf);
11833 let mut unstructured = Unstructured::new(&buf);
11834 Self::arbitrary(&mut unstructured).unwrap_or_default()
11835 }
11836}
11837impl Default for FLIGHT_INFORMATION_DATA {
11838 fn default() -> Self {
11839 Self::DEFAULT.clone()
11840 }
11841}
11842impl MessageData for FLIGHT_INFORMATION_DATA {
11843 type Message = MavMessage;
11844 const ID: u32 = 264u32;
11845 const NAME: &'static str = "FLIGHT_INFORMATION";
11846 const EXTRA_CRC: u8 = 49u8;
11847 const ENCODED_LEN: usize = 32usize;
11848 fn deser(
11849 _version: MavlinkVersion,
11850 __input: &[u8],
11851 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11852 let avail_len = __input.len();
11853 let mut payload_buf = [0; Self::ENCODED_LEN];
11854 let mut buf = if avail_len < Self::ENCODED_LEN {
11855 payload_buf[0..avail_len].copy_from_slice(__input);
11856 Bytes::new(&payload_buf)
11857 } else {
11858 Bytes::new(__input)
11859 };
11860 let mut __struct = Self::default();
11861 __struct.arming_time_utc = buf.get_u64_le();
11862 __struct.takeoff_time_utc = buf.get_u64_le();
11863 __struct.flight_uuid = buf.get_u64_le();
11864 __struct.time_boot_ms = buf.get_u32_le();
11865 __struct.landing_time = buf.get_u32_le();
11866 Ok(__struct)
11867 }
11868 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11869 let mut __tmp = BytesMut::new(bytes);
11870 #[allow(clippy::absurd_extreme_comparisons)]
11871 #[allow(unused_comparisons)]
11872 if __tmp.remaining() < Self::ENCODED_LEN {
11873 panic!(
11874 "buffer is too small (need {} bytes, but got {})",
11875 Self::ENCODED_LEN,
11876 __tmp.remaining(),
11877 )
11878 }
11879 __tmp.put_u64_le(self.arming_time_utc);
11880 __tmp.put_u64_le(self.takeoff_time_utc);
11881 __tmp.put_u64_le(self.flight_uuid);
11882 __tmp.put_u32_le(self.time_boot_ms);
11883 if matches!(version, MavlinkVersion::V2) {
11884 __tmp.put_u32_le(self.landing_time);
11885 let len = __tmp.len();
11886 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11887 } else {
11888 __tmp.len()
11889 }
11890 }
11891}
11892#[doc = "Current motion information from a designated system."]
11893#[doc = ""]
11894#[doc = "ID: 144"]
11895#[derive(Debug, Clone, PartialEq)]
11896#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11897#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11898#[cfg_attr(feature = "ts", derive(TS))]
11899#[cfg_attr(feature = "ts", ts(export))]
11900pub struct FOLLOW_TARGET_DATA {
11901 #[doc = "Timestamp (time since system boot)."]
11902 pub timestamp: u64,
11903 #[doc = "button states or switches of a tracker device"]
11904 pub custom_state: u64,
11905 #[doc = "Latitude (WGS84)"]
11906 pub lat: i32,
11907 #[doc = "Longitude (WGS84)"]
11908 pub lon: i32,
11909 #[doc = "Altitude (MSL)"]
11910 pub alt: f32,
11911 #[doc = "target velocity (0,0,0) for unknown"]
11912 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11913 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11914 pub vel: [f32; 3],
11915 #[doc = "linear target acceleration (0,0,0) for unknown"]
11916 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11917 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11918 pub acc: [f32; 3],
11919 #[doc = "(0 0 0 0 for unknown)"]
11920 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11921 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11922 pub attitude_q: [f32; 4],
11923 #[doc = "(0 0 0 for unknown)"]
11924 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11925 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11926 pub rates: [f32; 3],
11927 #[doc = "eph epv"]
11928 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11929 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11930 pub position_cov: [f32; 3],
11931 #[doc = "bit positions for tracker reporting capabilities (POS = 0, VEL = 1, ACCEL = 2, ATT + RATES = 3)"]
11932 pub est_capabilities: u8,
11933}
11934impl FOLLOW_TARGET_DATA {
11935 pub const ENCODED_LEN: usize = 93usize;
11936 pub const DEFAULT: Self = Self {
11937 timestamp: 0_u64,
11938 custom_state: 0_u64,
11939 lat: 0_i32,
11940 lon: 0_i32,
11941 alt: 0.0_f32,
11942 vel: [0.0_f32; 3usize],
11943 acc: [0.0_f32; 3usize],
11944 attitude_q: [0.0_f32; 4usize],
11945 rates: [0.0_f32; 3usize],
11946 position_cov: [0.0_f32; 3usize],
11947 est_capabilities: 0_u8,
11948 };
11949 #[cfg(feature = "arbitrary")]
11950 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11951 use arbitrary::{Arbitrary, Unstructured};
11952 let mut buf = [0u8; 1024];
11953 rng.fill_bytes(&mut buf);
11954 let mut unstructured = Unstructured::new(&buf);
11955 Self::arbitrary(&mut unstructured).unwrap_or_default()
11956 }
11957}
11958impl Default for FOLLOW_TARGET_DATA {
11959 fn default() -> Self {
11960 Self::DEFAULT.clone()
11961 }
11962}
11963impl MessageData for FOLLOW_TARGET_DATA {
11964 type Message = MavMessage;
11965 const ID: u32 = 144u32;
11966 const NAME: &'static str = "FOLLOW_TARGET";
11967 const EXTRA_CRC: u8 = 127u8;
11968 const ENCODED_LEN: usize = 93usize;
11969 fn deser(
11970 _version: MavlinkVersion,
11971 __input: &[u8],
11972 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11973 let avail_len = __input.len();
11974 let mut payload_buf = [0; Self::ENCODED_LEN];
11975 let mut buf = if avail_len < Self::ENCODED_LEN {
11976 payload_buf[0..avail_len].copy_from_slice(__input);
11977 Bytes::new(&payload_buf)
11978 } else {
11979 Bytes::new(__input)
11980 };
11981 let mut __struct = Self::default();
11982 __struct.timestamp = buf.get_u64_le();
11983 __struct.custom_state = buf.get_u64_le();
11984 __struct.lat = buf.get_i32_le();
11985 __struct.lon = buf.get_i32_le();
11986 __struct.alt = buf.get_f32_le();
11987 for v in &mut __struct.vel {
11988 let val = buf.get_f32_le();
11989 *v = val;
11990 }
11991 for v in &mut __struct.acc {
11992 let val = buf.get_f32_le();
11993 *v = val;
11994 }
11995 for v in &mut __struct.attitude_q {
11996 let val = buf.get_f32_le();
11997 *v = val;
11998 }
11999 for v in &mut __struct.rates {
12000 let val = buf.get_f32_le();
12001 *v = val;
12002 }
12003 for v in &mut __struct.position_cov {
12004 let val = buf.get_f32_le();
12005 *v = val;
12006 }
12007 __struct.est_capabilities = buf.get_u8();
12008 Ok(__struct)
12009 }
12010 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12011 let mut __tmp = BytesMut::new(bytes);
12012 #[allow(clippy::absurd_extreme_comparisons)]
12013 #[allow(unused_comparisons)]
12014 if __tmp.remaining() < Self::ENCODED_LEN {
12015 panic!(
12016 "buffer is too small (need {} bytes, but got {})",
12017 Self::ENCODED_LEN,
12018 __tmp.remaining(),
12019 )
12020 }
12021 __tmp.put_u64_le(self.timestamp);
12022 __tmp.put_u64_le(self.custom_state);
12023 __tmp.put_i32_le(self.lat);
12024 __tmp.put_i32_le(self.lon);
12025 __tmp.put_f32_le(self.alt);
12026 for val in &self.vel {
12027 __tmp.put_f32_le(*val);
12028 }
12029 for val in &self.acc {
12030 __tmp.put_f32_le(*val);
12031 }
12032 for val in &self.attitude_q {
12033 __tmp.put_f32_le(*val);
12034 }
12035 for val in &self.rates {
12036 __tmp.put_f32_le(*val);
12037 }
12038 for val in &self.position_cov {
12039 __tmp.put_f32_le(*val);
12040 }
12041 __tmp.put_u8(self.est_capabilities);
12042 if matches!(version, MavlinkVersion::V2) {
12043 let len = __tmp.len();
12044 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12045 } else {
12046 __tmp.len()
12047 }
12048 }
12049}
12050#[doc = "Fuel status. This message provides \"generic\" fuel level information for in a GCS and for triggering failsafes in an autopilot. The fuel type and associated units for fields in this message are defined in the enum MAV_FUEL_TYPE. The reported `consumed_fuel` and `remaining_fuel` must only be supplied if measured: they must not be inferred from the `maximum_fuel` and the other value. A recipient can assume that if these fields are supplied they are accurate. If not provided, the recipient can infer `remaining_fuel` from `maximum_fuel` and `consumed_fuel` on the assumption that the fuel was initially at its maximum (this is what battery monitors assume). Note however that this is an assumption, and the UI should prompt the user appropriately (i.e. notify user that they should fill the tank before boot). This kind of information may also be sent in fuel-specific messages such as BATTERY_STATUS_V2. If both messages are sent for the same fuel system, the ids and corresponding information must match. This should be streamed (nominally at 0.1 Hz)."]
12051#[doc = ""]
12052#[doc = "ID: 371"]
12053#[derive(Debug, Clone, PartialEq)]
12054#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12055#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12056#[cfg_attr(feature = "ts", derive(TS))]
12057#[cfg_attr(feature = "ts", ts(export))]
12058pub struct FUEL_STATUS_DATA {
12059 #[doc = "Capacity when full. Must be provided."]
12060 pub maximum_fuel: f32,
12061 #[doc = "Consumed fuel (measured). This value should not be inferred: if not measured set to NaN. NaN: field not provided."]
12062 pub consumed_fuel: f32,
12063 #[doc = "Remaining fuel until empty (measured). The value should not be inferred: if not measured set to NaN. NaN: field not provided."]
12064 pub remaining_fuel: f32,
12065 #[doc = "Positive value when emptying/using, and negative if filling/replacing. NaN: field not provided."]
12066 pub flow_rate: f32,
12067 #[doc = "Fuel temperature. NaN: field not provided."]
12068 pub temperature: f32,
12069 #[doc = "Fuel type. Defines units for fuel capacity and consumption fields above."]
12070 pub fuel_type: MavFuelType,
12071 #[doc = "Fuel ID. Must match ID of other messages for same fuel system, such as BATTERY_STATUS_V2."]
12072 pub id: u8,
12073 #[doc = "Percentage of remaining fuel, relative to full. Values: [0-100], UINT8_MAX: field not provided."]
12074 pub percent_remaining: u8,
12075}
12076impl FUEL_STATUS_DATA {
12077 pub const ENCODED_LEN: usize = 26usize;
12078 pub const DEFAULT: Self = Self {
12079 maximum_fuel: 0.0_f32,
12080 consumed_fuel: 0.0_f32,
12081 remaining_fuel: 0.0_f32,
12082 flow_rate: 0.0_f32,
12083 temperature: 0.0_f32,
12084 fuel_type: MavFuelType::DEFAULT,
12085 id: 0_u8,
12086 percent_remaining: 0_u8,
12087 };
12088 #[cfg(feature = "arbitrary")]
12089 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12090 use arbitrary::{Arbitrary, Unstructured};
12091 let mut buf = [0u8; 1024];
12092 rng.fill_bytes(&mut buf);
12093 let mut unstructured = Unstructured::new(&buf);
12094 Self::arbitrary(&mut unstructured).unwrap_or_default()
12095 }
12096}
12097impl Default for FUEL_STATUS_DATA {
12098 fn default() -> Self {
12099 Self::DEFAULT.clone()
12100 }
12101}
12102impl MessageData for FUEL_STATUS_DATA {
12103 type Message = MavMessage;
12104 const ID: u32 = 371u32;
12105 const NAME: &'static str = "FUEL_STATUS";
12106 const EXTRA_CRC: u8 = 10u8;
12107 const ENCODED_LEN: usize = 26usize;
12108 fn deser(
12109 _version: MavlinkVersion,
12110 __input: &[u8],
12111 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12112 let avail_len = __input.len();
12113 let mut payload_buf = [0; Self::ENCODED_LEN];
12114 let mut buf = if avail_len < Self::ENCODED_LEN {
12115 payload_buf[0..avail_len].copy_from_slice(__input);
12116 Bytes::new(&payload_buf)
12117 } else {
12118 Bytes::new(__input)
12119 };
12120 let mut __struct = Self::default();
12121 __struct.maximum_fuel = buf.get_f32_le();
12122 __struct.consumed_fuel = buf.get_f32_le();
12123 __struct.remaining_fuel = buf.get_f32_le();
12124 __struct.flow_rate = buf.get_f32_le();
12125 __struct.temperature = buf.get_f32_le();
12126 let tmp = buf.get_u32_le();
12127 __struct.fuel_type = FromPrimitive::from_u32(tmp).ok_or(
12128 ::mavlink_core::error::ParserError::InvalidEnum {
12129 enum_type: "MavFuelType",
12130 value: tmp as u64,
12131 },
12132 )?;
12133 __struct.id = buf.get_u8();
12134 __struct.percent_remaining = buf.get_u8();
12135 Ok(__struct)
12136 }
12137 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12138 let mut __tmp = BytesMut::new(bytes);
12139 #[allow(clippy::absurd_extreme_comparisons)]
12140 #[allow(unused_comparisons)]
12141 if __tmp.remaining() < Self::ENCODED_LEN {
12142 panic!(
12143 "buffer is too small (need {} bytes, but got {})",
12144 Self::ENCODED_LEN,
12145 __tmp.remaining(),
12146 )
12147 }
12148 __tmp.put_f32_le(self.maximum_fuel);
12149 __tmp.put_f32_le(self.consumed_fuel);
12150 __tmp.put_f32_le(self.remaining_fuel);
12151 __tmp.put_f32_le(self.flow_rate);
12152 __tmp.put_f32_le(self.temperature);
12153 __tmp.put_u32_le(self.fuel_type as u32);
12154 __tmp.put_u8(self.id);
12155 __tmp.put_u8(self.percent_remaining);
12156 if matches!(version, MavlinkVersion::V2) {
12157 let len = __tmp.len();
12158 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12159 } else {
12160 __tmp.len()
12161 }
12162 }
12163}
12164#[doc = "Telemetry of power generation system. Alternator or mechanical generator."]
12165#[doc = ""]
12166#[doc = "ID: 373"]
12167#[derive(Debug, Clone, PartialEq)]
12168#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12169#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12170#[cfg_attr(feature = "ts", derive(TS))]
12171#[cfg_attr(feature = "ts", ts(export))]
12172pub struct GENERATOR_STATUS_DATA {
12173 #[doc = "Status flags."]
12174 pub status: MavGeneratorStatusFlag,
12175 #[doc = "Current into/out of battery. Positive for out. Negative for in. NaN: field not provided."]
12176 pub battery_current: f32,
12177 #[doc = "Current going to the UAV. If battery current not available this is the DC current from the generator. Positive for out. Negative for in. NaN: field not provided"]
12178 pub load_current: f32,
12179 #[doc = "The power being generated. NaN: field not provided"]
12180 pub power_generated: f32,
12181 #[doc = "Voltage of the bus seen at the generator, or battery bus if battery bus is controlled by generator and at a different voltage to main bus."]
12182 pub bus_voltage: f32,
12183 #[doc = "The target battery current. Positive for out. Negative for in. NaN: field not provided"]
12184 pub bat_current_setpoint: f32,
12185 #[doc = "Seconds this generator has run since it was rebooted. UINT32_MAX: field not provided."]
12186 pub runtime: u32,
12187 #[doc = "Seconds until this generator requires maintenance. A negative value indicates maintenance is past-due. INT32_MAX: field not provided."]
12188 pub time_until_maintenance: i32,
12189 #[doc = "Speed of electrical generator or alternator. UINT16_MAX: field not provided."]
12190 pub generator_speed: u16,
12191 #[doc = "The temperature of the rectifier or power converter. INT16_MAX: field not provided."]
12192 pub rectifier_temperature: i16,
12193 #[doc = "The temperature of the mechanical motor, fuel cell core or generator. INT16_MAX: field not provided."]
12194 pub generator_temperature: i16,
12195}
12196impl GENERATOR_STATUS_DATA {
12197 pub const ENCODED_LEN: usize = 42usize;
12198 pub const DEFAULT: Self = Self {
12199 status: MavGeneratorStatusFlag::DEFAULT,
12200 battery_current: 0.0_f32,
12201 load_current: 0.0_f32,
12202 power_generated: 0.0_f32,
12203 bus_voltage: 0.0_f32,
12204 bat_current_setpoint: 0.0_f32,
12205 runtime: 0_u32,
12206 time_until_maintenance: 0_i32,
12207 generator_speed: 0_u16,
12208 rectifier_temperature: 0_i16,
12209 generator_temperature: 0_i16,
12210 };
12211 #[cfg(feature = "arbitrary")]
12212 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12213 use arbitrary::{Arbitrary, Unstructured};
12214 let mut buf = [0u8; 1024];
12215 rng.fill_bytes(&mut buf);
12216 let mut unstructured = Unstructured::new(&buf);
12217 Self::arbitrary(&mut unstructured).unwrap_or_default()
12218 }
12219}
12220impl Default for GENERATOR_STATUS_DATA {
12221 fn default() -> Self {
12222 Self::DEFAULT.clone()
12223 }
12224}
12225impl MessageData for GENERATOR_STATUS_DATA {
12226 type Message = MavMessage;
12227 const ID: u32 = 373u32;
12228 const NAME: &'static str = "GENERATOR_STATUS";
12229 const EXTRA_CRC: u8 = 117u8;
12230 const ENCODED_LEN: usize = 42usize;
12231 fn deser(
12232 _version: MavlinkVersion,
12233 __input: &[u8],
12234 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12235 let avail_len = __input.len();
12236 let mut payload_buf = [0; Self::ENCODED_LEN];
12237 let mut buf = if avail_len < Self::ENCODED_LEN {
12238 payload_buf[0..avail_len].copy_from_slice(__input);
12239 Bytes::new(&payload_buf)
12240 } else {
12241 Bytes::new(__input)
12242 };
12243 let mut __struct = Self::default();
12244 let tmp = buf.get_u64_le();
12245 __struct.status = MavGeneratorStatusFlag::from_bits(tmp).ok_or(
12246 ::mavlink_core::error::ParserError::InvalidFlag {
12247 flag_type: "MavGeneratorStatusFlag",
12248 value: tmp as u64,
12249 },
12250 )?;
12251 __struct.battery_current = buf.get_f32_le();
12252 __struct.load_current = buf.get_f32_le();
12253 __struct.power_generated = buf.get_f32_le();
12254 __struct.bus_voltage = buf.get_f32_le();
12255 __struct.bat_current_setpoint = buf.get_f32_le();
12256 __struct.runtime = buf.get_u32_le();
12257 __struct.time_until_maintenance = buf.get_i32_le();
12258 __struct.generator_speed = buf.get_u16_le();
12259 __struct.rectifier_temperature = buf.get_i16_le();
12260 __struct.generator_temperature = buf.get_i16_le();
12261 Ok(__struct)
12262 }
12263 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12264 let mut __tmp = BytesMut::new(bytes);
12265 #[allow(clippy::absurd_extreme_comparisons)]
12266 #[allow(unused_comparisons)]
12267 if __tmp.remaining() < Self::ENCODED_LEN {
12268 panic!(
12269 "buffer is too small (need {} bytes, but got {})",
12270 Self::ENCODED_LEN,
12271 __tmp.remaining(),
12272 )
12273 }
12274 __tmp.put_u64_le(self.status.bits());
12275 __tmp.put_f32_le(self.battery_current);
12276 __tmp.put_f32_le(self.load_current);
12277 __tmp.put_f32_le(self.power_generated);
12278 __tmp.put_f32_le(self.bus_voltage);
12279 __tmp.put_f32_le(self.bat_current_setpoint);
12280 __tmp.put_u32_le(self.runtime);
12281 __tmp.put_i32_le(self.time_until_maintenance);
12282 __tmp.put_u16_le(self.generator_speed);
12283 __tmp.put_i16_le(self.rectifier_temperature);
12284 __tmp.put_i16_le(self.generator_temperature);
12285 if matches!(version, MavlinkVersion::V2) {
12286 let len = __tmp.len();
12287 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12288 } else {
12289 __tmp.len()
12290 }
12291 }
12292}
12293#[doc = "Message reporting the status of a gimbal device. \t This message should be broadcast by a gimbal device component at a low regular rate (e.g. 5 Hz). \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Other conditions of the flags are not allowed. \t The quaternion and angular velocities in the other frame can be calculated from delta_yaw and delta_yaw_velocity as \t q_earth = q_delta_yaw * q_vehicle and w_earth = w_delta_yaw_velocity + w_vehicle (if not NaN). \t If neither the GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME nor the GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME flag is set, \t then (for backwards compatibility) the data in the delta_yaw and delta_yaw_velocity fields are to be ignored. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME, \t and always should set delta_yaw and delta_yaw_velocity either to the proper value or NaN."]
12294#[doc = ""]
12295#[doc = "ID: 285"]
12296#[derive(Debug, Clone, PartialEq)]
12297#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12298#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12299#[cfg_attr(feature = "ts", derive(TS))]
12300#[cfg_attr(feature = "ts", ts(export))]
12301pub struct GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
12302 #[doc = "Timestamp (time since system boot)."]
12303 pub time_boot_ms: u32,
12304 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation). The frame is described in the message description."]
12305 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12306 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12307 pub q: [f32; 4],
12308 #[doc = "X component of angular velocity (positive: rolling to the right). The frame is described in the message description. NaN if unknown."]
12309 pub angular_velocity_x: f32,
12310 #[doc = "Y component of angular velocity (positive: pitching up). The frame is described in the message description. NaN if unknown."]
12311 pub angular_velocity_y: f32,
12312 #[doc = "Z component of angular velocity (positive: yawing to the right). The frame is described in the message description. NaN if unknown."]
12313 pub angular_velocity_z: f32,
12314 #[doc = "Failure flags (0 for no failure)"]
12315 pub failure_flags: GimbalDeviceErrorFlags,
12316 #[doc = "Current gimbal flags set."]
12317 pub flags: GimbalDeviceFlags,
12318 #[doc = "System ID"]
12319 pub target_system: u8,
12320 #[doc = "Component ID"]
12321 pub target_component: u8,
12322 #[doc = "Yaw angle relating the quaternions in earth and body frames (see message description). NaN if unknown."]
12323 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12324 pub delta_yaw: f32,
12325 #[doc = "Yaw angular velocity relating the angular velocities in earth and body frames (see message description). NaN if unknown."]
12326 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12327 pub delta_yaw_velocity: f32,
12328 #[doc = "This field is to be used if the gimbal manager and the gimbal device are the same component and hence have the same component ID. This field is then set a number between 1-6. If the component ID is separate, this field is not required and must be set to 0."]
12329 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12330 pub gimbal_device_id: u8,
12331}
12332impl GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
12333 pub const ENCODED_LEN: usize = 49usize;
12334 pub const DEFAULT: Self = Self {
12335 time_boot_ms: 0_u32,
12336 q: [0.0_f32; 4usize],
12337 angular_velocity_x: 0.0_f32,
12338 angular_velocity_y: 0.0_f32,
12339 angular_velocity_z: 0.0_f32,
12340 failure_flags: GimbalDeviceErrorFlags::DEFAULT,
12341 flags: GimbalDeviceFlags::DEFAULT,
12342 target_system: 0_u8,
12343 target_component: 0_u8,
12344 delta_yaw: 0.0_f32,
12345 delta_yaw_velocity: 0.0_f32,
12346 gimbal_device_id: 0_u8,
12347 };
12348 #[cfg(feature = "arbitrary")]
12349 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12350 use arbitrary::{Arbitrary, Unstructured};
12351 let mut buf = [0u8; 1024];
12352 rng.fill_bytes(&mut buf);
12353 let mut unstructured = Unstructured::new(&buf);
12354 Self::arbitrary(&mut unstructured).unwrap_or_default()
12355 }
12356}
12357impl Default for GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
12358 fn default() -> Self {
12359 Self::DEFAULT.clone()
12360 }
12361}
12362impl MessageData for GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
12363 type Message = MavMessage;
12364 const ID: u32 = 285u32;
12365 const NAME: &'static str = "GIMBAL_DEVICE_ATTITUDE_STATUS";
12366 const EXTRA_CRC: u8 = 137u8;
12367 const ENCODED_LEN: usize = 49usize;
12368 fn deser(
12369 _version: MavlinkVersion,
12370 __input: &[u8],
12371 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12372 let avail_len = __input.len();
12373 let mut payload_buf = [0; Self::ENCODED_LEN];
12374 let mut buf = if avail_len < Self::ENCODED_LEN {
12375 payload_buf[0..avail_len].copy_from_slice(__input);
12376 Bytes::new(&payload_buf)
12377 } else {
12378 Bytes::new(__input)
12379 };
12380 let mut __struct = Self::default();
12381 __struct.time_boot_ms = buf.get_u32_le();
12382 for v in &mut __struct.q {
12383 let val = buf.get_f32_le();
12384 *v = val;
12385 }
12386 __struct.angular_velocity_x = buf.get_f32_le();
12387 __struct.angular_velocity_y = buf.get_f32_le();
12388 __struct.angular_velocity_z = buf.get_f32_le();
12389 let tmp = buf.get_u32_le();
12390 __struct.failure_flags = GimbalDeviceErrorFlags::from_bits(tmp).ok_or(
12391 ::mavlink_core::error::ParserError::InvalidFlag {
12392 flag_type: "GimbalDeviceErrorFlags",
12393 value: tmp as u64,
12394 },
12395 )?;
12396 let tmp = buf.get_u16_le();
12397 __struct.flags = GimbalDeviceFlags::from_bits(tmp).ok_or(
12398 ::mavlink_core::error::ParserError::InvalidFlag {
12399 flag_type: "GimbalDeviceFlags",
12400 value: tmp as u64,
12401 },
12402 )?;
12403 __struct.target_system = buf.get_u8();
12404 __struct.target_component = buf.get_u8();
12405 __struct.delta_yaw = buf.get_f32_le();
12406 __struct.delta_yaw_velocity = buf.get_f32_le();
12407 __struct.gimbal_device_id = buf.get_u8();
12408 Ok(__struct)
12409 }
12410 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12411 let mut __tmp = BytesMut::new(bytes);
12412 #[allow(clippy::absurd_extreme_comparisons)]
12413 #[allow(unused_comparisons)]
12414 if __tmp.remaining() < Self::ENCODED_LEN {
12415 panic!(
12416 "buffer is too small (need {} bytes, but got {})",
12417 Self::ENCODED_LEN,
12418 __tmp.remaining(),
12419 )
12420 }
12421 __tmp.put_u32_le(self.time_boot_ms);
12422 for val in &self.q {
12423 __tmp.put_f32_le(*val);
12424 }
12425 __tmp.put_f32_le(self.angular_velocity_x);
12426 __tmp.put_f32_le(self.angular_velocity_y);
12427 __tmp.put_f32_le(self.angular_velocity_z);
12428 __tmp.put_u32_le(self.failure_flags.bits());
12429 __tmp.put_u16_le(self.flags.bits());
12430 __tmp.put_u8(self.target_system);
12431 __tmp.put_u8(self.target_component);
12432 if matches!(version, MavlinkVersion::V2) {
12433 __tmp.put_f32_le(self.delta_yaw);
12434 __tmp.put_f32_le(self.delta_yaw_velocity);
12435 __tmp.put_u8(self.gimbal_device_id);
12436 let len = __tmp.len();
12437 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12438 } else {
12439 __tmp.len()
12440 }
12441 }
12442}
12443#[doc = "Information about a low level gimbal. This message should be requested by the gimbal manager or a ground station using MAV_CMD_REQUEST_MESSAGE. The maximum angles and rates are the limits by hardware. However, the limits by software used are likely different/smaller and dependent on mode/settings/etc.."]
12444#[doc = ""]
12445#[doc = "ID: 283"]
12446#[derive(Debug, Clone, PartialEq)]
12447#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12448#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12449#[cfg_attr(feature = "ts", derive(TS))]
12450#[cfg_attr(feature = "ts", ts(export))]
12451pub struct GIMBAL_DEVICE_INFORMATION_DATA {
12452 #[doc = "UID of gimbal hardware (0 if unknown)."]
12453 pub uid: u64,
12454 #[doc = "Timestamp (time since system boot)."]
12455 pub time_boot_ms: u32,
12456 #[doc = "0xff)."]
12457 pub firmware_version: u32,
12458 #[doc = "0xff)."]
12459 pub hardware_version: u32,
12460 #[doc = "Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left). NAN if unknown."]
12461 pub roll_min: f32,
12462 #[doc = "Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left). NAN if unknown."]
12463 pub roll_max: f32,
12464 #[doc = "Minimum hardware pitch angle (positive: up, negative: down). NAN if unknown."]
12465 pub pitch_min: f32,
12466 #[doc = "Maximum hardware pitch angle (positive: up, negative: down). NAN if unknown."]
12467 pub pitch_max: f32,
12468 #[doc = "Minimum hardware yaw angle (positive: to the right, negative: to the left). NAN if unknown."]
12469 pub yaw_min: f32,
12470 #[doc = "Maximum hardware yaw angle (positive: to the right, negative: to the left). NAN if unknown."]
12471 pub yaw_max: f32,
12472 #[doc = "Bitmap of gimbal capability flags."]
12473 pub cap_flags: GimbalDeviceCapFlags,
12474 #[doc = "Bitmap for use for gimbal-specific capability flags."]
12475 pub custom_cap_flags: u16,
12476 #[doc = "Name of the gimbal vendor."]
12477 #[cfg_attr(feature = "ts", ts(type = "string"))]
12478 pub vendor_name: CharArray<32>,
12479 #[doc = "Name of the gimbal model."]
12480 #[cfg_attr(feature = "ts", ts(type = "string"))]
12481 pub model_name: CharArray<32>,
12482 #[doc = "Custom name of the gimbal given to it by the user."]
12483 #[cfg_attr(feature = "ts", ts(type = "string"))]
12484 pub custom_name: CharArray<32>,
12485 #[doc = "This field is to be used if the gimbal manager and the gimbal device are the same component and hence have the same component ID. This field is then set to a number between 1-6. If the component ID is separate, this field is not required and must be set to 0."]
12486 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12487 pub gimbal_device_id: u8,
12488}
12489impl GIMBAL_DEVICE_INFORMATION_DATA {
12490 pub const ENCODED_LEN: usize = 145usize;
12491 pub const DEFAULT: Self = Self {
12492 uid: 0_u64,
12493 time_boot_ms: 0_u32,
12494 firmware_version: 0_u32,
12495 hardware_version: 0_u32,
12496 roll_min: 0.0_f32,
12497 roll_max: 0.0_f32,
12498 pitch_min: 0.0_f32,
12499 pitch_max: 0.0_f32,
12500 yaw_min: 0.0_f32,
12501 yaw_max: 0.0_f32,
12502 cap_flags: GimbalDeviceCapFlags::DEFAULT,
12503 custom_cap_flags: 0_u16,
12504 vendor_name: CharArray::new([0_u8; 32usize]),
12505 model_name: CharArray::new([0_u8; 32usize]),
12506 custom_name: CharArray::new([0_u8; 32usize]),
12507 gimbal_device_id: 0_u8,
12508 };
12509 #[cfg(feature = "arbitrary")]
12510 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12511 use arbitrary::{Arbitrary, Unstructured};
12512 let mut buf = [0u8; 1024];
12513 rng.fill_bytes(&mut buf);
12514 let mut unstructured = Unstructured::new(&buf);
12515 Self::arbitrary(&mut unstructured).unwrap_or_default()
12516 }
12517}
12518impl Default for GIMBAL_DEVICE_INFORMATION_DATA {
12519 fn default() -> Self {
12520 Self::DEFAULT.clone()
12521 }
12522}
12523impl MessageData for GIMBAL_DEVICE_INFORMATION_DATA {
12524 type Message = MavMessage;
12525 const ID: u32 = 283u32;
12526 const NAME: &'static str = "GIMBAL_DEVICE_INFORMATION";
12527 const EXTRA_CRC: u8 = 74u8;
12528 const ENCODED_LEN: usize = 145usize;
12529 fn deser(
12530 _version: MavlinkVersion,
12531 __input: &[u8],
12532 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12533 let avail_len = __input.len();
12534 let mut payload_buf = [0; Self::ENCODED_LEN];
12535 let mut buf = if avail_len < Self::ENCODED_LEN {
12536 payload_buf[0..avail_len].copy_from_slice(__input);
12537 Bytes::new(&payload_buf)
12538 } else {
12539 Bytes::new(__input)
12540 };
12541 let mut __struct = Self::default();
12542 __struct.uid = buf.get_u64_le();
12543 __struct.time_boot_ms = buf.get_u32_le();
12544 __struct.firmware_version = buf.get_u32_le();
12545 __struct.hardware_version = buf.get_u32_le();
12546 __struct.roll_min = buf.get_f32_le();
12547 __struct.roll_max = buf.get_f32_le();
12548 __struct.pitch_min = buf.get_f32_le();
12549 __struct.pitch_max = buf.get_f32_le();
12550 __struct.yaw_min = buf.get_f32_le();
12551 __struct.yaw_max = buf.get_f32_le();
12552 let tmp = buf.get_u16_le();
12553 __struct.cap_flags = GimbalDeviceCapFlags::from_bits(tmp).ok_or(
12554 ::mavlink_core::error::ParserError::InvalidFlag {
12555 flag_type: "GimbalDeviceCapFlags",
12556 value: tmp as u64,
12557 },
12558 )?;
12559 __struct.custom_cap_flags = buf.get_u16_le();
12560 let mut tmp = [0_u8; 32usize];
12561 for v in &mut tmp {
12562 *v = buf.get_u8();
12563 }
12564 __struct.vendor_name = CharArray::new(tmp);
12565 let mut tmp = [0_u8; 32usize];
12566 for v in &mut tmp {
12567 *v = buf.get_u8();
12568 }
12569 __struct.model_name = CharArray::new(tmp);
12570 let mut tmp = [0_u8; 32usize];
12571 for v in &mut tmp {
12572 *v = buf.get_u8();
12573 }
12574 __struct.custom_name = CharArray::new(tmp);
12575 __struct.gimbal_device_id = buf.get_u8();
12576 Ok(__struct)
12577 }
12578 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12579 let mut __tmp = BytesMut::new(bytes);
12580 #[allow(clippy::absurd_extreme_comparisons)]
12581 #[allow(unused_comparisons)]
12582 if __tmp.remaining() < Self::ENCODED_LEN {
12583 panic!(
12584 "buffer is too small (need {} bytes, but got {})",
12585 Self::ENCODED_LEN,
12586 __tmp.remaining(),
12587 )
12588 }
12589 __tmp.put_u64_le(self.uid);
12590 __tmp.put_u32_le(self.time_boot_ms);
12591 __tmp.put_u32_le(self.firmware_version);
12592 __tmp.put_u32_le(self.hardware_version);
12593 __tmp.put_f32_le(self.roll_min);
12594 __tmp.put_f32_le(self.roll_max);
12595 __tmp.put_f32_le(self.pitch_min);
12596 __tmp.put_f32_le(self.pitch_max);
12597 __tmp.put_f32_le(self.yaw_min);
12598 __tmp.put_f32_le(self.yaw_max);
12599 __tmp.put_u16_le(self.cap_flags.bits());
12600 __tmp.put_u16_le(self.custom_cap_flags);
12601 for val in &self.vendor_name {
12602 __tmp.put_u8(*val);
12603 }
12604 for val in &self.model_name {
12605 __tmp.put_u8(*val);
12606 }
12607 for val in &self.custom_name {
12608 __tmp.put_u8(*val);
12609 }
12610 if matches!(version, MavlinkVersion::V2) {
12611 __tmp.put_u8(self.gimbal_device_id);
12612 let len = __tmp.len();
12613 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12614 } else {
12615 __tmp.len()
12616 }
12617 }
12618}
12619#[doc = "Low level message to control a gimbal device's attitude. \t This message is to be sent from the gimbal manager to the gimbal device component. \t The quaternion and angular velocities can be set to NaN according to use case. \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Setting both GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME and GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is not allowed. \t These rules are to ensure backwards compatibility. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."]
12620#[doc = ""]
12621#[doc = "ID: 284"]
12622#[derive(Debug, Clone, PartialEq)]
12623#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12624#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12625#[cfg_attr(feature = "ts", derive(TS))]
12626#[cfg_attr(feature = "ts", ts(export))]
12627pub struct GIMBAL_DEVICE_SET_ATTITUDE_DATA {
12628 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation). The frame is described in the message description. Set fields to NaN to be ignored."]
12629 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12630 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12631 pub q: [f32; 4],
12632 #[doc = "X component of angular velocity (positive: rolling to the right). The frame is described in the message description. NaN to be ignored."]
12633 pub angular_velocity_x: f32,
12634 #[doc = "Y component of angular velocity (positive: pitching up). The frame is described in the message description. NaN to be ignored."]
12635 pub angular_velocity_y: f32,
12636 #[doc = "Z component of angular velocity (positive: yawing to the right). The frame is described in the message description. NaN to be ignored."]
12637 pub angular_velocity_z: f32,
12638 #[doc = "Low level gimbal flags."]
12639 pub flags: GimbalDeviceFlags,
12640 #[doc = "System ID"]
12641 pub target_system: u8,
12642 #[doc = "Component ID"]
12643 pub target_component: u8,
12644}
12645impl GIMBAL_DEVICE_SET_ATTITUDE_DATA {
12646 pub const ENCODED_LEN: usize = 32usize;
12647 pub const DEFAULT: Self = Self {
12648 q: [0.0_f32; 4usize],
12649 angular_velocity_x: 0.0_f32,
12650 angular_velocity_y: 0.0_f32,
12651 angular_velocity_z: 0.0_f32,
12652 flags: GimbalDeviceFlags::DEFAULT,
12653 target_system: 0_u8,
12654 target_component: 0_u8,
12655 };
12656 #[cfg(feature = "arbitrary")]
12657 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12658 use arbitrary::{Arbitrary, Unstructured};
12659 let mut buf = [0u8; 1024];
12660 rng.fill_bytes(&mut buf);
12661 let mut unstructured = Unstructured::new(&buf);
12662 Self::arbitrary(&mut unstructured).unwrap_or_default()
12663 }
12664}
12665impl Default for GIMBAL_DEVICE_SET_ATTITUDE_DATA {
12666 fn default() -> Self {
12667 Self::DEFAULT.clone()
12668 }
12669}
12670impl MessageData for GIMBAL_DEVICE_SET_ATTITUDE_DATA {
12671 type Message = MavMessage;
12672 const ID: u32 = 284u32;
12673 const NAME: &'static str = "GIMBAL_DEVICE_SET_ATTITUDE";
12674 const EXTRA_CRC: u8 = 99u8;
12675 const ENCODED_LEN: usize = 32usize;
12676 fn deser(
12677 _version: MavlinkVersion,
12678 __input: &[u8],
12679 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12680 let avail_len = __input.len();
12681 let mut payload_buf = [0; Self::ENCODED_LEN];
12682 let mut buf = if avail_len < Self::ENCODED_LEN {
12683 payload_buf[0..avail_len].copy_from_slice(__input);
12684 Bytes::new(&payload_buf)
12685 } else {
12686 Bytes::new(__input)
12687 };
12688 let mut __struct = Self::default();
12689 for v in &mut __struct.q {
12690 let val = buf.get_f32_le();
12691 *v = val;
12692 }
12693 __struct.angular_velocity_x = buf.get_f32_le();
12694 __struct.angular_velocity_y = buf.get_f32_le();
12695 __struct.angular_velocity_z = buf.get_f32_le();
12696 let tmp = buf.get_u16_le();
12697 __struct.flags = GimbalDeviceFlags::from_bits(tmp).ok_or(
12698 ::mavlink_core::error::ParserError::InvalidFlag {
12699 flag_type: "GimbalDeviceFlags",
12700 value: tmp as u64,
12701 },
12702 )?;
12703 __struct.target_system = buf.get_u8();
12704 __struct.target_component = buf.get_u8();
12705 Ok(__struct)
12706 }
12707 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12708 let mut __tmp = BytesMut::new(bytes);
12709 #[allow(clippy::absurd_extreme_comparisons)]
12710 #[allow(unused_comparisons)]
12711 if __tmp.remaining() < Self::ENCODED_LEN {
12712 panic!(
12713 "buffer is too small (need {} bytes, but got {})",
12714 Self::ENCODED_LEN,
12715 __tmp.remaining(),
12716 )
12717 }
12718 for val in &self.q {
12719 __tmp.put_f32_le(*val);
12720 }
12721 __tmp.put_f32_le(self.angular_velocity_x);
12722 __tmp.put_f32_le(self.angular_velocity_y);
12723 __tmp.put_f32_le(self.angular_velocity_z);
12724 __tmp.put_u16_le(self.flags.bits());
12725 __tmp.put_u8(self.target_system);
12726 __tmp.put_u8(self.target_component);
12727 if matches!(version, MavlinkVersion::V2) {
12728 let len = __tmp.len();
12729 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12730 } else {
12731 __tmp.len()
12732 }
12733 }
12734}
12735#[doc = "Information about a high level gimbal manager. This message should be requested by a ground station using MAV_CMD_REQUEST_MESSAGE."]
12736#[doc = ""]
12737#[doc = "ID: 280"]
12738#[derive(Debug, Clone, PartialEq)]
12739#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12740#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12741#[cfg_attr(feature = "ts", derive(TS))]
12742#[cfg_attr(feature = "ts", ts(export))]
12743pub struct GIMBAL_MANAGER_INFORMATION_DATA {
12744 #[doc = "Timestamp (time since system boot)."]
12745 pub time_boot_ms: u32,
12746 #[doc = "Bitmap of gimbal capability flags."]
12747 pub cap_flags: GimbalManagerCapFlags,
12748 #[doc = "Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left)"]
12749 pub roll_min: f32,
12750 #[doc = "Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left)"]
12751 pub roll_max: f32,
12752 #[doc = "Minimum pitch angle (positive: up, negative: down)"]
12753 pub pitch_min: f32,
12754 #[doc = "Maximum pitch angle (positive: up, negative: down)"]
12755 pub pitch_max: f32,
12756 #[doc = "Minimum yaw angle (positive: to the right, negative: to the left)"]
12757 pub yaw_min: f32,
12758 #[doc = "Maximum yaw angle (positive: to the right, negative: to the left)"]
12759 pub yaw_max: f32,
12760 #[doc = "Gimbal device ID that this gimbal manager is responsible for. Component ID of gimbal device (or 1-6 for non-MAVLink gimbal)."]
12761 pub gimbal_device_id: u8,
12762}
12763impl GIMBAL_MANAGER_INFORMATION_DATA {
12764 pub const ENCODED_LEN: usize = 33usize;
12765 pub const DEFAULT: Self = Self {
12766 time_boot_ms: 0_u32,
12767 cap_flags: GimbalManagerCapFlags::DEFAULT,
12768 roll_min: 0.0_f32,
12769 roll_max: 0.0_f32,
12770 pitch_min: 0.0_f32,
12771 pitch_max: 0.0_f32,
12772 yaw_min: 0.0_f32,
12773 yaw_max: 0.0_f32,
12774 gimbal_device_id: 0_u8,
12775 };
12776 #[cfg(feature = "arbitrary")]
12777 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12778 use arbitrary::{Arbitrary, Unstructured};
12779 let mut buf = [0u8; 1024];
12780 rng.fill_bytes(&mut buf);
12781 let mut unstructured = Unstructured::new(&buf);
12782 Self::arbitrary(&mut unstructured).unwrap_or_default()
12783 }
12784}
12785impl Default for GIMBAL_MANAGER_INFORMATION_DATA {
12786 fn default() -> Self {
12787 Self::DEFAULT.clone()
12788 }
12789}
12790impl MessageData for GIMBAL_MANAGER_INFORMATION_DATA {
12791 type Message = MavMessage;
12792 const ID: u32 = 280u32;
12793 const NAME: &'static str = "GIMBAL_MANAGER_INFORMATION";
12794 const EXTRA_CRC: u8 = 70u8;
12795 const ENCODED_LEN: usize = 33usize;
12796 fn deser(
12797 _version: MavlinkVersion,
12798 __input: &[u8],
12799 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12800 let avail_len = __input.len();
12801 let mut payload_buf = [0; Self::ENCODED_LEN];
12802 let mut buf = if avail_len < Self::ENCODED_LEN {
12803 payload_buf[0..avail_len].copy_from_slice(__input);
12804 Bytes::new(&payload_buf)
12805 } else {
12806 Bytes::new(__input)
12807 };
12808 let mut __struct = Self::default();
12809 __struct.time_boot_ms = buf.get_u32_le();
12810 let tmp = buf.get_u32_le();
12811 __struct.cap_flags = GimbalManagerCapFlags::from_bits(tmp).ok_or(
12812 ::mavlink_core::error::ParserError::InvalidFlag {
12813 flag_type: "GimbalManagerCapFlags",
12814 value: tmp as u64,
12815 },
12816 )?;
12817 __struct.roll_min = buf.get_f32_le();
12818 __struct.roll_max = buf.get_f32_le();
12819 __struct.pitch_min = buf.get_f32_le();
12820 __struct.pitch_max = buf.get_f32_le();
12821 __struct.yaw_min = buf.get_f32_le();
12822 __struct.yaw_max = buf.get_f32_le();
12823 __struct.gimbal_device_id = buf.get_u8();
12824 Ok(__struct)
12825 }
12826 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12827 let mut __tmp = BytesMut::new(bytes);
12828 #[allow(clippy::absurd_extreme_comparisons)]
12829 #[allow(unused_comparisons)]
12830 if __tmp.remaining() < Self::ENCODED_LEN {
12831 panic!(
12832 "buffer is too small (need {} bytes, but got {})",
12833 Self::ENCODED_LEN,
12834 __tmp.remaining(),
12835 )
12836 }
12837 __tmp.put_u32_le(self.time_boot_ms);
12838 __tmp.put_u32_le(self.cap_flags.bits());
12839 __tmp.put_f32_le(self.roll_min);
12840 __tmp.put_f32_le(self.roll_max);
12841 __tmp.put_f32_le(self.pitch_min);
12842 __tmp.put_f32_le(self.pitch_max);
12843 __tmp.put_f32_le(self.yaw_min);
12844 __tmp.put_f32_le(self.yaw_max);
12845 __tmp.put_u8(self.gimbal_device_id);
12846 if matches!(version, MavlinkVersion::V2) {
12847 let len = __tmp.len();
12848 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12849 } else {
12850 __tmp.len()
12851 }
12852 }
12853}
12854#[doc = "High level message to control a gimbal's attitude. This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
12855#[doc = ""]
12856#[doc = "ID: 282"]
12857#[derive(Debug, Clone, PartialEq)]
12858#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12859#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12860#[cfg_attr(feature = "ts", derive(TS))]
12861#[cfg_attr(feature = "ts", ts(export))]
12862pub struct GIMBAL_MANAGER_SET_ATTITUDE_DATA {
12863 #[doc = "High level gimbal manager flags to use."]
12864 pub flags: GimbalManagerFlags,
12865 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation, the frame is depends on whether the flag GIMBAL_MANAGER_FLAGS_YAW_LOCK is set)"]
12866 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12867 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12868 pub q: [f32; 4],
12869 #[doc = "X component of angular velocity, positive is rolling to the right, NaN to be ignored."]
12870 pub angular_velocity_x: f32,
12871 #[doc = "Y component of angular velocity, positive is pitching up, NaN to be ignored."]
12872 pub angular_velocity_y: f32,
12873 #[doc = "Z component of angular velocity, positive is yawing to the right, NaN to be ignored."]
12874 pub angular_velocity_z: f32,
12875 #[doc = "System ID"]
12876 pub target_system: u8,
12877 #[doc = "Component ID"]
12878 pub target_component: u8,
12879 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
12880 pub gimbal_device_id: u8,
12881}
12882impl GIMBAL_MANAGER_SET_ATTITUDE_DATA {
12883 pub const ENCODED_LEN: usize = 35usize;
12884 pub const DEFAULT: Self = Self {
12885 flags: GimbalManagerFlags::DEFAULT,
12886 q: [0.0_f32; 4usize],
12887 angular_velocity_x: 0.0_f32,
12888 angular_velocity_y: 0.0_f32,
12889 angular_velocity_z: 0.0_f32,
12890 target_system: 0_u8,
12891 target_component: 0_u8,
12892 gimbal_device_id: 0_u8,
12893 };
12894 #[cfg(feature = "arbitrary")]
12895 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12896 use arbitrary::{Arbitrary, Unstructured};
12897 let mut buf = [0u8; 1024];
12898 rng.fill_bytes(&mut buf);
12899 let mut unstructured = Unstructured::new(&buf);
12900 Self::arbitrary(&mut unstructured).unwrap_or_default()
12901 }
12902}
12903impl Default for GIMBAL_MANAGER_SET_ATTITUDE_DATA {
12904 fn default() -> Self {
12905 Self::DEFAULT.clone()
12906 }
12907}
12908impl MessageData for GIMBAL_MANAGER_SET_ATTITUDE_DATA {
12909 type Message = MavMessage;
12910 const ID: u32 = 282u32;
12911 const NAME: &'static str = "GIMBAL_MANAGER_SET_ATTITUDE";
12912 const EXTRA_CRC: u8 = 123u8;
12913 const ENCODED_LEN: usize = 35usize;
12914 fn deser(
12915 _version: MavlinkVersion,
12916 __input: &[u8],
12917 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12918 let avail_len = __input.len();
12919 let mut payload_buf = [0; Self::ENCODED_LEN];
12920 let mut buf = if avail_len < Self::ENCODED_LEN {
12921 payload_buf[0..avail_len].copy_from_slice(__input);
12922 Bytes::new(&payload_buf)
12923 } else {
12924 Bytes::new(__input)
12925 };
12926 let mut __struct = Self::default();
12927 let tmp = buf.get_u32_le();
12928 __struct.flags = GimbalManagerFlags::from_bits(tmp).ok_or(
12929 ::mavlink_core::error::ParserError::InvalidFlag {
12930 flag_type: "GimbalManagerFlags",
12931 value: tmp as u64,
12932 },
12933 )?;
12934 for v in &mut __struct.q {
12935 let val = buf.get_f32_le();
12936 *v = val;
12937 }
12938 __struct.angular_velocity_x = buf.get_f32_le();
12939 __struct.angular_velocity_y = buf.get_f32_le();
12940 __struct.angular_velocity_z = buf.get_f32_le();
12941 __struct.target_system = buf.get_u8();
12942 __struct.target_component = buf.get_u8();
12943 __struct.gimbal_device_id = buf.get_u8();
12944 Ok(__struct)
12945 }
12946 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12947 let mut __tmp = BytesMut::new(bytes);
12948 #[allow(clippy::absurd_extreme_comparisons)]
12949 #[allow(unused_comparisons)]
12950 if __tmp.remaining() < Self::ENCODED_LEN {
12951 panic!(
12952 "buffer is too small (need {} bytes, but got {})",
12953 Self::ENCODED_LEN,
12954 __tmp.remaining(),
12955 )
12956 }
12957 __tmp.put_u32_le(self.flags.bits());
12958 for val in &self.q {
12959 __tmp.put_f32_le(*val);
12960 }
12961 __tmp.put_f32_le(self.angular_velocity_x);
12962 __tmp.put_f32_le(self.angular_velocity_y);
12963 __tmp.put_f32_le(self.angular_velocity_z);
12964 __tmp.put_u8(self.target_system);
12965 __tmp.put_u8(self.target_component);
12966 __tmp.put_u8(self.gimbal_device_id);
12967 if matches!(version, MavlinkVersion::V2) {
12968 let len = __tmp.len();
12969 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12970 } else {
12971 __tmp.len()
12972 }
12973 }
12974}
12975#[doc = "High level message to control a gimbal manually. The angles or angular rates are unitless; the actual rates will depend on internal gimbal manager settings/configuration (e.g. set by parameters). This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
12976#[doc = ""]
12977#[doc = "ID: 288"]
12978#[derive(Debug, Clone, PartialEq)]
12979#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12980#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12981#[cfg_attr(feature = "ts", derive(TS))]
12982#[cfg_attr(feature = "ts", ts(export))]
12983pub struct GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
12984 #[doc = "High level gimbal manager flags."]
12985 pub flags: GimbalManagerFlags,
12986 #[doc = "Pitch angle unitless (-1..1, positive: up, negative: down, NaN to be ignored)."]
12987 pub pitch: f32,
12988 #[doc = "Yaw angle unitless (-1..1, positive: to the right, negative: to the left, NaN to be ignored)."]
12989 pub yaw: f32,
12990 #[doc = "Pitch angular rate unitless (-1..1, positive: up, negative: down, NaN to be ignored)."]
12991 pub pitch_rate: f32,
12992 #[doc = "Yaw angular rate unitless (-1..1, positive: to the right, negative: to the left, NaN to be ignored)."]
12993 pub yaw_rate: f32,
12994 #[doc = "System ID"]
12995 pub target_system: u8,
12996 #[doc = "Component ID"]
12997 pub target_component: u8,
12998 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
12999 pub gimbal_device_id: u8,
13000}
13001impl GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
13002 pub const ENCODED_LEN: usize = 23usize;
13003 pub const DEFAULT: Self = Self {
13004 flags: GimbalManagerFlags::DEFAULT,
13005 pitch: 0.0_f32,
13006 yaw: 0.0_f32,
13007 pitch_rate: 0.0_f32,
13008 yaw_rate: 0.0_f32,
13009 target_system: 0_u8,
13010 target_component: 0_u8,
13011 gimbal_device_id: 0_u8,
13012 };
13013 #[cfg(feature = "arbitrary")]
13014 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13015 use arbitrary::{Arbitrary, Unstructured};
13016 let mut buf = [0u8; 1024];
13017 rng.fill_bytes(&mut buf);
13018 let mut unstructured = Unstructured::new(&buf);
13019 Self::arbitrary(&mut unstructured).unwrap_or_default()
13020 }
13021}
13022impl Default for GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
13023 fn default() -> Self {
13024 Self::DEFAULT.clone()
13025 }
13026}
13027impl MessageData for GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
13028 type Message = MavMessage;
13029 const ID: u32 = 288u32;
13030 const NAME: &'static str = "GIMBAL_MANAGER_SET_MANUAL_CONTROL";
13031 const EXTRA_CRC: u8 = 20u8;
13032 const ENCODED_LEN: usize = 23usize;
13033 fn deser(
13034 _version: MavlinkVersion,
13035 __input: &[u8],
13036 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13037 let avail_len = __input.len();
13038 let mut payload_buf = [0; Self::ENCODED_LEN];
13039 let mut buf = if avail_len < Self::ENCODED_LEN {
13040 payload_buf[0..avail_len].copy_from_slice(__input);
13041 Bytes::new(&payload_buf)
13042 } else {
13043 Bytes::new(__input)
13044 };
13045 let mut __struct = Self::default();
13046 let tmp = buf.get_u32_le();
13047 __struct.flags = GimbalManagerFlags::from_bits(tmp).ok_or(
13048 ::mavlink_core::error::ParserError::InvalidFlag {
13049 flag_type: "GimbalManagerFlags",
13050 value: tmp as u64,
13051 },
13052 )?;
13053 __struct.pitch = buf.get_f32_le();
13054 __struct.yaw = buf.get_f32_le();
13055 __struct.pitch_rate = buf.get_f32_le();
13056 __struct.yaw_rate = buf.get_f32_le();
13057 __struct.target_system = buf.get_u8();
13058 __struct.target_component = buf.get_u8();
13059 __struct.gimbal_device_id = buf.get_u8();
13060 Ok(__struct)
13061 }
13062 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13063 let mut __tmp = BytesMut::new(bytes);
13064 #[allow(clippy::absurd_extreme_comparisons)]
13065 #[allow(unused_comparisons)]
13066 if __tmp.remaining() < Self::ENCODED_LEN {
13067 panic!(
13068 "buffer is too small (need {} bytes, but got {})",
13069 Self::ENCODED_LEN,
13070 __tmp.remaining(),
13071 )
13072 }
13073 __tmp.put_u32_le(self.flags.bits());
13074 __tmp.put_f32_le(self.pitch);
13075 __tmp.put_f32_le(self.yaw);
13076 __tmp.put_f32_le(self.pitch_rate);
13077 __tmp.put_f32_le(self.yaw_rate);
13078 __tmp.put_u8(self.target_system);
13079 __tmp.put_u8(self.target_component);
13080 __tmp.put_u8(self.gimbal_device_id);
13081 if matches!(version, MavlinkVersion::V2) {
13082 let len = __tmp.len();
13083 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13084 } else {
13085 __tmp.len()
13086 }
13087 }
13088}
13089#[doc = "Set gimbal manager pitch and yaw angles (high rate message). This message is to be sent to the gimbal manager (e.g. from a ground station) and will be ignored by gimbal devices. Angles and rates can be set to NaN according to use case. Use MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW for low-rate adjustments that require confirmation."]
13090#[doc = ""]
13091#[doc = "ID: 287"]
13092#[derive(Debug, Clone, PartialEq)]
13093#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13094#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13095#[cfg_attr(feature = "ts", derive(TS))]
13096#[cfg_attr(feature = "ts", ts(export))]
13097pub struct GIMBAL_MANAGER_SET_PITCHYAW_DATA {
13098 #[doc = "High level gimbal manager flags to use."]
13099 pub flags: GimbalManagerFlags,
13100 #[doc = "Pitch angle (positive: up, negative: down, NaN to be ignored)."]
13101 pub pitch: f32,
13102 #[doc = "Yaw angle (positive: to the right, negative: to the left, NaN to be ignored)."]
13103 pub yaw: f32,
13104 #[doc = "Pitch angular rate (positive: up, negative: down, NaN to be ignored)."]
13105 pub pitch_rate: f32,
13106 #[doc = "Yaw angular rate (positive: to the right, negative: to the left, NaN to be ignored)."]
13107 pub yaw_rate: f32,
13108 #[doc = "System ID"]
13109 pub target_system: u8,
13110 #[doc = "Component ID"]
13111 pub target_component: u8,
13112 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
13113 pub gimbal_device_id: u8,
13114}
13115impl GIMBAL_MANAGER_SET_PITCHYAW_DATA {
13116 pub const ENCODED_LEN: usize = 23usize;
13117 pub const DEFAULT: Self = Self {
13118 flags: GimbalManagerFlags::DEFAULT,
13119 pitch: 0.0_f32,
13120 yaw: 0.0_f32,
13121 pitch_rate: 0.0_f32,
13122 yaw_rate: 0.0_f32,
13123 target_system: 0_u8,
13124 target_component: 0_u8,
13125 gimbal_device_id: 0_u8,
13126 };
13127 #[cfg(feature = "arbitrary")]
13128 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13129 use arbitrary::{Arbitrary, Unstructured};
13130 let mut buf = [0u8; 1024];
13131 rng.fill_bytes(&mut buf);
13132 let mut unstructured = Unstructured::new(&buf);
13133 Self::arbitrary(&mut unstructured).unwrap_or_default()
13134 }
13135}
13136impl Default for GIMBAL_MANAGER_SET_PITCHYAW_DATA {
13137 fn default() -> Self {
13138 Self::DEFAULT.clone()
13139 }
13140}
13141impl MessageData for GIMBAL_MANAGER_SET_PITCHYAW_DATA {
13142 type Message = MavMessage;
13143 const ID: u32 = 287u32;
13144 const NAME: &'static str = "GIMBAL_MANAGER_SET_PITCHYAW";
13145 const EXTRA_CRC: u8 = 1u8;
13146 const ENCODED_LEN: usize = 23usize;
13147 fn deser(
13148 _version: MavlinkVersion,
13149 __input: &[u8],
13150 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13151 let avail_len = __input.len();
13152 let mut payload_buf = [0; Self::ENCODED_LEN];
13153 let mut buf = if avail_len < Self::ENCODED_LEN {
13154 payload_buf[0..avail_len].copy_from_slice(__input);
13155 Bytes::new(&payload_buf)
13156 } else {
13157 Bytes::new(__input)
13158 };
13159 let mut __struct = Self::default();
13160 let tmp = buf.get_u32_le();
13161 __struct.flags = GimbalManagerFlags::from_bits(tmp).ok_or(
13162 ::mavlink_core::error::ParserError::InvalidFlag {
13163 flag_type: "GimbalManagerFlags",
13164 value: tmp as u64,
13165 },
13166 )?;
13167 __struct.pitch = buf.get_f32_le();
13168 __struct.yaw = buf.get_f32_le();
13169 __struct.pitch_rate = buf.get_f32_le();
13170 __struct.yaw_rate = buf.get_f32_le();
13171 __struct.target_system = buf.get_u8();
13172 __struct.target_component = buf.get_u8();
13173 __struct.gimbal_device_id = buf.get_u8();
13174 Ok(__struct)
13175 }
13176 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13177 let mut __tmp = BytesMut::new(bytes);
13178 #[allow(clippy::absurd_extreme_comparisons)]
13179 #[allow(unused_comparisons)]
13180 if __tmp.remaining() < Self::ENCODED_LEN {
13181 panic!(
13182 "buffer is too small (need {} bytes, but got {})",
13183 Self::ENCODED_LEN,
13184 __tmp.remaining(),
13185 )
13186 }
13187 __tmp.put_u32_le(self.flags.bits());
13188 __tmp.put_f32_le(self.pitch);
13189 __tmp.put_f32_le(self.yaw);
13190 __tmp.put_f32_le(self.pitch_rate);
13191 __tmp.put_f32_le(self.yaw_rate);
13192 __tmp.put_u8(self.target_system);
13193 __tmp.put_u8(self.target_component);
13194 __tmp.put_u8(self.gimbal_device_id);
13195 if matches!(version, MavlinkVersion::V2) {
13196 let len = __tmp.len();
13197 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13198 } else {
13199 __tmp.len()
13200 }
13201 }
13202}
13203#[doc = "Current status about a high level gimbal manager. This message should be broadcast at a low regular rate (e.g. 5Hz)."]
13204#[doc = ""]
13205#[doc = "ID: 281"]
13206#[derive(Debug, Clone, PartialEq)]
13207#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13208#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13209#[cfg_attr(feature = "ts", derive(TS))]
13210#[cfg_attr(feature = "ts", ts(export))]
13211pub struct GIMBAL_MANAGER_STATUS_DATA {
13212 #[doc = "Timestamp (time since system boot)."]
13213 pub time_boot_ms: u32,
13214 #[doc = "High level gimbal manager flags currently applied."]
13215 pub flags: GimbalManagerFlags,
13216 #[doc = "Gimbal device ID that this gimbal manager is responsible for. Component ID of gimbal device (or 1-6 for non-MAVLink gimbal)."]
13217 pub gimbal_device_id: u8,
13218 #[doc = "System ID of MAVLink component with primary control, 0 for none."]
13219 pub primary_control_sysid: u8,
13220 #[doc = "Component ID of MAVLink component with primary control, 0 for none."]
13221 pub primary_control_compid: u8,
13222 #[doc = "System ID of MAVLink component with secondary control, 0 for none."]
13223 pub secondary_control_sysid: u8,
13224 #[doc = "Component ID of MAVLink component with secondary control, 0 for none."]
13225 pub secondary_control_compid: u8,
13226}
13227impl GIMBAL_MANAGER_STATUS_DATA {
13228 pub const ENCODED_LEN: usize = 13usize;
13229 pub const DEFAULT: Self = Self {
13230 time_boot_ms: 0_u32,
13231 flags: GimbalManagerFlags::DEFAULT,
13232 gimbal_device_id: 0_u8,
13233 primary_control_sysid: 0_u8,
13234 primary_control_compid: 0_u8,
13235 secondary_control_sysid: 0_u8,
13236 secondary_control_compid: 0_u8,
13237 };
13238 #[cfg(feature = "arbitrary")]
13239 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13240 use arbitrary::{Arbitrary, Unstructured};
13241 let mut buf = [0u8; 1024];
13242 rng.fill_bytes(&mut buf);
13243 let mut unstructured = Unstructured::new(&buf);
13244 Self::arbitrary(&mut unstructured).unwrap_or_default()
13245 }
13246}
13247impl Default for GIMBAL_MANAGER_STATUS_DATA {
13248 fn default() -> Self {
13249 Self::DEFAULT.clone()
13250 }
13251}
13252impl MessageData for GIMBAL_MANAGER_STATUS_DATA {
13253 type Message = MavMessage;
13254 const ID: u32 = 281u32;
13255 const NAME: &'static str = "GIMBAL_MANAGER_STATUS";
13256 const EXTRA_CRC: u8 = 48u8;
13257 const ENCODED_LEN: usize = 13usize;
13258 fn deser(
13259 _version: MavlinkVersion,
13260 __input: &[u8],
13261 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13262 let avail_len = __input.len();
13263 let mut payload_buf = [0; Self::ENCODED_LEN];
13264 let mut buf = if avail_len < Self::ENCODED_LEN {
13265 payload_buf[0..avail_len].copy_from_slice(__input);
13266 Bytes::new(&payload_buf)
13267 } else {
13268 Bytes::new(__input)
13269 };
13270 let mut __struct = Self::default();
13271 __struct.time_boot_ms = buf.get_u32_le();
13272 let tmp = buf.get_u32_le();
13273 __struct.flags = GimbalManagerFlags::from_bits(tmp).ok_or(
13274 ::mavlink_core::error::ParserError::InvalidFlag {
13275 flag_type: "GimbalManagerFlags",
13276 value: tmp as u64,
13277 },
13278 )?;
13279 __struct.gimbal_device_id = buf.get_u8();
13280 __struct.primary_control_sysid = buf.get_u8();
13281 __struct.primary_control_compid = buf.get_u8();
13282 __struct.secondary_control_sysid = buf.get_u8();
13283 __struct.secondary_control_compid = buf.get_u8();
13284 Ok(__struct)
13285 }
13286 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13287 let mut __tmp = BytesMut::new(bytes);
13288 #[allow(clippy::absurd_extreme_comparisons)]
13289 #[allow(unused_comparisons)]
13290 if __tmp.remaining() < Self::ENCODED_LEN {
13291 panic!(
13292 "buffer is too small (need {} bytes, but got {})",
13293 Self::ENCODED_LEN,
13294 __tmp.remaining(),
13295 )
13296 }
13297 __tmp.put_u32_le(self.time_boot_ms);
13298 __tmp.put_u32_le(self.flags.bits());
13299 __tmp.put_u8(self.gimbal_device_id);
13300 __tmp.put_u8(self.primary_control_sysid);
13301 __tmp.put_u8(self.primary_control_compid);
13302 __tmp.put_u8(self.secondary_control_sysid);
13303 __tmp.put_u8(self.secondary_control_compid);
13304 if matches!(version, MavlinkVersion::V2) {
13305 let len = __tmp.len();
13306 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13307 } else {
13308 __tmp.len()
13309 }
13310 }
13311}
13312#[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient."]
13313#[doc = ""]
13314#[doc = "ID: 33"]
13315#[derive(Debug, Clone, PartialEq)]
13316#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13317#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13318#[cfg_attr(feature = "ts", derive(TS))]
13319#[cfg_attr(feature = "ts", ts(export))]
13320pub struct GLOBAL_POSITION_INT_DATA {
13321 #[doc = "Timestamp (time since system boot)."]
13322 pub time_boot_ms: u32,
13323 #[doc = "Latitude, expressed"]
13324 pub lat: i32,
13325 #[doc = "Longitude, expressed"]
13326 pub lon: i32,
13327 #[doc = "Altitude (MSL). Note that virtually all GPS modules provide both WGS84 and MSL."]
13328 pub alt: i32,
13329 #[doc = "Altitude above home"]
13330 pub relative_alt: i32,
13331 #[doc = "Ground X Speed (Latitude, positive north)"]
13332 pub vx: i16,
13333 #[doc = "Ground Y Speed (Longitude, positive east)"]
13334 pub vy: i16,
13335 #[doc = "Ground Z Speed (Altitude, positive down)"]
13336 pub vz: i16,
13337 #[doc = "Vehicle heading (yaw angle), 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
13338 pub hdg: u16,
13339}
13340impl GLOBAL_POSITION_INT_DATA {
13341 pub const ENCODED_LEN: usize = 28usize;
13342 pub const DEFAULT: Self = Self {
13343 time_boot_ms: 0_u32,
13344 lat: 0_i32,
13345 lon: 0_i32,
13346 alt: 0_i32,
13347 relative_alt: 0_i32,
13348 vx: 0_i16,
13349 vy: 0_i16,
13350 vz: 0_i16,
13351 hdg: 0_u16,
13352 };
13353 #[cfg(feature = "arbitrary")]
13354 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13355 use arbitrary::{Arbitrary, Unstructured};
13356 let mut buf = [0u8; 1024];
13357 rng.fill_bytes(&mut buf);
13358 let mut unstructured = Unstructured::new(&buf);
13359 Self::arbitrary(&mut unstructured).unwrap_or_default()
13360 }
13361}
13362impl Default for GLOBAL_POSITION_INT_DATA {
13363 fn default() -> Self {
13364 Self::DEFAULT.clone()
13365 }
13366}
13367impl MessageData for GLOBAL_POSITION_INT_DATA {
13368 type Message = MavMessage;
13369 const ID: u32 = 33u32;
13370 const NAME: &'static str = "GLOBAL_POSITION_INT";
13371 const EXTRA_CRC: u8 = 104u8;
13372 const ENCODED_LEN: usize = 28usize;
13373 fn deser(
13374 _version: MavlinkVersion,
13375 __input: &[u8],
13376 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13377 let avail_len = __input.len();
13378 let mut payload_buf = [0; Self::ENCODED_LEN];
13379 let mut buf = if avail_len < Self::ENCODED_LEN {
13380 payload_buf[0..avail_len].copy_from_slice(__input);
13381 Bytes::new(&payload_buf)
13382 } else {
13383 Bytes::new(__input)
13384 };
13385 let mut __struct = Self::default();
13386 __struct.time_boot_ms = buf.get_u32_le();
13387 __struct.lat = buf.get_i32_le();
13388 __struct.lon = buf.get_i32_le();
13389 __struct.alt = buf.get_i32_le();
13390 __struct.relative_alt = buf.get_i32_le();
13391 __struct.vx = buf.get_i16_le();
13392 __struct.vy = buf.get_i16_le();
13393 __struct.vz = buf.get_i16_le();
13394 __struct.hdg = buf.get_u16_le();
13395 Ok(__struct)
13396 }
13397 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13398 let mut __tmp = BytesMut::new(bytes);
13399 #[allow(clippy::absurd_extreme_comparisons)]
13400 #[allow(unused_comparisons)]
13401 if __tmp.remaining() < Self::ENCODED_LEN {
13402 panic!(
13403 "buffer is too small (need {} bytes, but got {})",
13404 Self::ENCODED_LEN,
13405 __tmp.remaining(),
13406 )
13407 }
13408 __tmp.put_u32_le(self.time_boot_ms);
13409 __tmp.put_i32_le(self.lat);
13410 __tmp.put_i32_le(self.lon);
13411 __tmp.put_i32_le(self.alt);
13412 __tmp.put_i32_le(self.relative_alt);
13413 __tmp.put_i16_le(self.vx);
13414 __tmp.put_i16_le(self.vy);
13415 __tmp.put_i16_le(self.vz);
13416 __tmp.put_u16_le(self.hdg);
13417 if matches!(version, MavlinkVersion::V2) {
13418 let len = __tmp.len();
13419 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13420 } else {
13421 __tmp.len()
13422 }
13423 }
13424}
13425#[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient. NOTE: This message is intended for onboard networks / companion computers and higher-bandwidth links and optimized for accuracy and completeness. Please use the GLOBAL_POSITION_INT message for a minimal subset."]
13426#[doc = ""]
13427#[doc = "ID: 63"]
13428#[derive(Debug, Clone, PartialEq)]
13429#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13430#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13431#[cfg_attr(feature = "ts", derive(TS))]
13432#[cfg_attr(feature = "ts", ts(export))]
13433pub struct GLOBAL_POSITION_INT_COV_DATA {
13434 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
13435 pub time_usec: u64,
13436 #[doc = "Latitude"]
13437 pub lat: i32,
13438 #[doc = "Longitude"]
13439 pub lon: i32,
13440 #[doc = "Altitude in meters above MSL"]
13441 pub alt: i32,
13442 #[doc = "Altitude above ground"]
13443 pub relative_alt: i32,
13444 #[doc = "Ground X Speed (Latitude)"]
13445 pub vx: f32,
13446 #[doc = "Ground Y Speed (Longitude)"]
13447 pub vy: f32,
13448 #[doc = "Ground Z Speed (Altitude)"]
13449 pub vz: f32,
13450 #[doc = "Row-major representation of a 6x6 position and velocity 6x6 cross-covariance matrix (states: lat, lon, alt, vx, vy, vz; first six entries are the first ROW, next six entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
13451 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13452 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
13453 pub covariance: [f32; 36],
13454 #[doc = "Class id of the estimator this estimate originated from."]
13455 pub estimator_type: MavEstimatorType,
13456}
13457impl GLOBAL_POSITION_INT_COV_DATA {
13458 pub const ENCODED_LEN: usize = 181usize;
13459 pub const DEFAULT: Self = Self {
13460 time_usec: 0_u64,
13461 lat: 0_i32,
13462 lon: 0_i32,
13463 alt: 0_i32,
13464 relative_alt: 0_i32,
13465 vx: 0.0_f32,
13466 vy: 0.0_f32,
13467 vz: 0.0_f32,
13468 covariance: [0.0_f32; 36usize],
13469 estimator_type: MavEstimatorType::DEFAULT,
13470 };
13471 #[cfg(feature = "arbitrary")]
13472 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13473 use arbitrary::{Arbitrary, Unstructured};
13474 let mut buf = [0u8; 1024];
13475 rng.fill_bytes(&mut buf);
13476 let mut unstructured = Unstructured::new(&buf);
13477 Self::arbitrary(&mut unstructured).unwrap_or_default()
13478 }
13479}
13480impl Default for GLOBAL_POSITION_INT_COV_DATA {
13481 fn default() -> Self {
13482 Self::DEFAULT.clone()
13483 }
13484}
13485impl MessageData for GLOBAL_POSITION_INT_COV_DATA {
13486 type Message = MavMessage;
13487 const ID: u32 = 63u32;
13488 const NAME: &'static str = "GLOBAL_POSITION_INT_COV";
13489 const EXTRA_CRC: u8 = 119u8;
13490 const ENCODED_LEN: usize = 181usize;
13491 fn deser(
13492 _version: MavlinkVersion,
13493 __input: &[u8],
13494 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13495 let avail_len = __input.len();
13496 let mut payload_buf = [0; Self::ENCODED_LEN];
13497 let mut buf = if avail_len < Self::ENCODED_LEN {
13498 payload_buf[0..avail_len].copy_from_slice(__input);
13499 Bytes::new(&payload_buf)
13500 } else {
13501 Bytes::new(__input)
13502 };
13503 let mut __struct = Self::default();
13504 __struct.time_usec = buf.get_u64_le();
13505 __struct.lat = buf.get_i32_le();
13506 __struct.lon = buf.get_i32_le();
13507 __struct.alt = buf.get_i32_le();
13508 __struct.relative_alt = buf.get_i32_le();
13509 __struct.vx = buf.get_f32_le();
13510 __struct.vy = buf.get_f32_le();
13511 __struct.vz = buf.get_f32_le();
13512 for v in &mut __struct.covariance {
13513 let val = buf.get_f32_le();
13514 *v = val;
13515 }
13516 let tmp = buf.get_u8();
13517 __struct.estimator_type =
13518 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
13519 enum_type: "MavEstimatorType",
13520 value: tmp as u64,
13521 })?;
13522 Ok(__struct)
13523 }
13524 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13525 let mut __tmp = BytesMut::new(bytes);
13526 #[allow(clippy::absurd_extreme_comparisons)]
13527 #[allow(unused_comparisons)]
13528 if __tmp.remaining() < Self::ENCODED_LEN {
13529 panic!(
13530 "buffer is too small (need {} bytes, but got {})",
13531 Self::ENCODED_LEN,
13532 __tmp.remaining(),
13533 )
13534 }
13535 __tmp.put_u64_le(self.time_usec);
13536 __tmp.put_i32_le(self.lat);
13537 __tmp.put_i32_le(self.lon);
13538 __tmp.put_i32_le(self.alt);
13539 __tmp.put_i32_le(self.relative_alt);
13540 __tmp.put_f32_le(self.vx);
13541 __tmp.put_f32_le(self.vy);
13542 __tmp.put_f32_le(self.vz);
13543 for val in &self.covariance {
13544 __tmp.put_f32_le(*val);
13545 }
13546 __tmp.put_u8(self.estimator_type as u8);
13547 if matches!(version, MavlinkVersion::V2) {
13548 let len = __tmp.len();
13549 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13550 } else {
13551 __tmp.len()
13552 }
13553 }
13554}
13555#[doc = "Global position/attitude estimate from a vision source."]
13556#[doc = ""]
13557#[doc = "ID: 101"]
13558#[derive(Debug, Clone, PartialEq)]
13559#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13560#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13561#[cfg_attr(feature = "ts", derive(TS))]
13562#[cfg_attr(feature = "ts", ts(export))]
13563pub struct GLOBAL_VISION_POSITION_ESTIMATE_DATA {
13564 #[doc = "Timestamp (UNIX time or since system boot)"]
13565 pub usec: u64,
13566 #[doc = "Global X position"]
13567 pub x: f32,
13568 #[doc = "Global Y position"]
13569 pub y: f32,
13570 #[doc = "Global Z position"]
13571 pub z: f32,
13572 #[doc = "Roll angle"]
13573 pub roll: f32,
13574 #[doc = "Pitch angle"]
13575 pub pitch: f32,
13576 #[doc = "Yaw angle"]
13577 pub yaw: f32,
13578 #[doc = "Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: x_global, y_global, z_global, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
13579 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13580 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13581 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
13582 pub covariance: [f32; 21],
13583 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
13584 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13585 pub reset_counter: u8,
13586}
13587impl GLOBAL_VISION_POSITION_ESTIMATE_DATA {
13588 pub const ENCODED_LEN: usize = 117usize;
13589 pub const DEFAULT: Self = Self {
13590 usec: 0_u64,
13591 x: 0.0_f32,
13592 y: 0.0_f32,
13593 z: 0.0_f32,
13594 roll: 0.0_f32,
13595 pitch: 0.0_f32,
13596 yaw: 0.0_f32,
13597 covariance: [0.0_f32; 21usize],
13598 reset_counter: 0_u8,
13599 };
13600 #[cfg(feature = "arbitrary")]
13601 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13602 use arbitrary::{Arbitrary, Unstructured};
13603 let mut buf = [0u8; 1024];
13604 rng.fill_bytes(&mut buf);
13605 let mut unstructured = Unstructured::new(&buf);
13606 Self::arbitrary(&mut unstructured).unwrap_or_default()
13607 }
13608}
13609impl Default for GLOBAL_VISION_POSITION_ESTIMATE_DATA {
13610 fn default() -> Self {
13611 Self::DEFAULT.clone()
13612 }
13613}
13614impl MessageData for GLOBAL_VISION_POSITION_ESTIMATE_DATA {
13615 type Message = MavMessage;
13616 const ID: u32 = 101u32;
13617 const NAME: &'static str = "GLOBAL_VISION_POSITION_ESTIMATE";
13618 const EXTRA_CRC: u8 = 102u8;
13619 const ENCODED_LEN: usize = 117usize;
13620 fn deser(
13621 _version: MavlinkVersion,
13622 __input: &[u8],
13623 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13624 let avail_len = __input.len();
13625 let mut payload_buf = [0; Self::ENCODED_LEN];
13626 let mut buf = if avail_len < Self::ENCODED_LEN {
13627 payload_buf[0..avail_len].copy_from_slice(__input);
13628 Bytes::new(&payload_buf)
13629 } else {
13630 Bytes::new(__input)
13631 };
13632 let mut __struct = Self::default();
13633 __struct.usec = buf.get_u64_le();
13634 __struct.x = buf.get_f32_le();
13635 __struct.y = buf.get_f32_le();
13636 __struct.z = buf.get_f32_le();
13637 __struct.roll = buf.get_f32_le();
13638 __struct.pitch = buf.get_f32_le();
13639 __struct.yaw = buf.get_f32_le();
13640 for v in &mut __struct.covariance {
13641 let val = buf.get_f32_le();
13642 *v = val;
13643 }
13644 __struct.reset_counter = buf.get_u8();
13645 Ok(__struct)
13646 }
13647 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13648 let mut __tmp = BytesMut::new(bytes);
13649 #[allow(clippy::absurd_extreme_comparisons)]
13650 #[allow(unused_comparisons)]
13651 if __tmp.remaining() < Self::ENCODED_LEN {
13652 panic!(
13653 "buffer is too small (need {} bytes, but got {})",
13654 Self::ENCODED_LEN,
13655 __tmp.remaining(),
13656 )
13657 }
13658 __tmp.put_u64_le(self.usec);
13659 __tmp.put_f32_le(self.x);
13660 __tmp.put_f32_le(self.y);
13661 __tmp.put_f32_le(self.z);
13662 __tmp.put_f32_le(self.roll);
13663 __tmp.put_f32_le(self.pitch);
13664 __tmp.put_f32_le(self.yaw);
13665 if matches!(version, MavlinkVersion::V2) {
13666 for val in &self.covariance {
13667 __tmp.put_f32_le(*val);
13668 }
13669 __tmp.put_u8(self.reset_counter);
13670 let len = __tmp.len();
13671 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13672 } else {
13673 __tmp.len()
13674 }
13675 }
13676}
13677#[doc = "Second GPS data."]
13678#[doc = ""]
13679#[doc = "ID: 124"]
13680#[derive(Debug, Clone, PartialEq)]
13681#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13682#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13683#[cfg_attr(feature = "ts", derive(TS))]
13684#[cfg_attr(feature = "ts", ts(export))]
13685pub struct GPS2_RAW_DATA {
13686 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
13687 pub time_usec: u64,
13688 #[doc = "Latitude (WGS84)"]
13689 pub lat: i32,
13690 #[doc = "Longitude (WGS84)"]
13691 pub lon: i32,
13692 #[doc = "Altitude (MSL). Positive for up."]
13693 pub alt: i32,
13694 #[doc = "Age of DGPS info"]
13695 pub dgps_age: u32,
13696 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
13697 pub eph: u16,
13698 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
13699 pub epv: u16,
13700 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
13701 pub vel: u16,
13702 #[doc = "Course over ground (NOT heading, but direction of movement): 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
13703 pub cog: u16,
13704 #[doc = "GPS fix type."]
13705 pub fix_type: GpsFixType,
13706 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
13707 pub satellites_visible: u8,
13708 #[doc = "Number of DGPS satellites"]
13709 pub dgps_numch: u8,
13710 #[doc = "Yaw in earth frame from north. Use 0 if this GPS does not provide yaw. Use UINT16_MAX if this GPS is configured to provide yaw and is currently unable to provide it. Use 36000 for north."]
13711 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13712 pub yaw: u16,
13713 #[doc = "Altitude (above WGS84, EGM96 ellipsoid). Positive for up."]
13714 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13715 pub alt_ellipsoid: i32,
13716 #[doc = "Position uncertainty."]
13717 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13718 pub h_acc: u32,
13719 #[doc = "Altitude uncertainty."]
13720 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13721 pub v_acc: u32,
13722 #[doc = "Speed uncertainty."]
13723 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13724 pub vel_acc: u32,
13725 #[doc = "Heading / track uncertainty"]
13726 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13727 pub hdg_acc: u32,
13728}
13729impl GPS2_RAW_DATA {
13730 pub const ENCODED_LEN: usize = 57usize;
13731 pub const DEFAULT: Self = Self {
13732 time_usec: 0_u64,
13733 lat: 0_i32,
13734 lon: 0_i32,
13735 alt: 0_i32,
13736 dgps_age: 0_u32,
13737 eph: 0_u16,
13738 epv: 0_u16,
13739 vel: 0_u16,
13740 cog: 0_u16,
13741 fix_type: GpsFixType::DEFAULT,
13742 satellites_visible: 0_u8,
13743 dgps_numch: 0_u8,
13744 yaw: 0_u16,
13745 alt_ellipsoid: 0_i32,
13746 h_acc: 0_u32,
13747 v_acc: 0_u32,
13748 vel_acc: 0_u32,
13749 hdg_acc: 0_u32,
13750 };
13751 #[cfg(feature = "arbitrary")]
13752 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13753 use arbitrary::{Arbitrary, Unstructured};
13754 let mut buf = [0u8; 1024];
13755 rng.fill_bytes(&mut buf);
13756 let mut unstructured = Unstructured::new(&buf);
13757 Self::arbitrary(&mut unstructured).unwrap_or_default()
13758 }
13759}
13760impl Default for GPS2_RAW_DATA {
13761 fn default() -> Self {
13762 Self::DEFAULT.clone()
13763 }
13764}
13765impl MessageData for GPS2_RAW_DATA {
13766 type Message = MavMessage;
13767 const ID: u32 = 124u32;
13768 const NAME: &'static str = "GPS2_RAW";
13769 const EXTRA_CRC: u8 = 87u8;
13770 const ENCODED_LEN: usize = 57usize;
13771 fn deser(
13772 _version: MavlinkVersion,
13773 __input: &[u8],
13774 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13775 let avail_len = __input.len();
13776 let mut payload_buf = [0; Self::ENCODED_LEN];
13777 let mut buf = if avail_len < Self::ENCODED_LEN {
13778 payload_buf[0..avail_len].copy_from_slice(__input);
13779 Bytes::new(&payload_buf)
13780 } else {
13781 Bytes::new(__input)
13782 };
13783 let mut __struct = Self::default();
13784 __struct.time_usec = buf.get_u64_le();
13785 __struct.lat = buf.get_i32_le();
13786 __struct.lon = buf.get_i32_le();
13787 __struct.alt = buf.get_i32_le();
13788 __struct.dgps_age = buf.get_u32_le();
13789 __struct.eph = buf.get_u16_le();
13790 __struct.epv = buf.get_u16_le();
13791 __struct.vel = buf.get_u16_le();
13792 __struct.cog = buf.get_u16_le();
13793 let tmp = buf.get_u8();
13794 __struct.fix_type =
13795 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
13796 enum_type: "GpsFixType",
13797 value: tmp as u64,
13798 })?;
13799 __struct.satellites_visible = buf.get_u8();
13800 __struct.dgps_numch = buf.get_u8();
13801 __struct.yaw = buf.get_u16_le();
13802 __struct.alt_ellipsoid = buf.get_i32_le();
13803 __struct.h_acc = buf.get_u32_le();
13804 __struct.v_acc = buf.get_u32_le();
13805 __struct.vel_acc = buf.get_u32_le();
13806 __struct.hdg_acc = buf.get_u32_le();
13807 Ok(__struct)
13808 }
13809 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13810 let mut __tmp = BytesMut::new(bytes);
13811 #[allow(clippy::absurd_extreme_comparisons)]
13812 #[allow(unused_comparisons)]
13813 if __tmp.remaining() < Self::ENCODED_LEN {
13814 panic!(
13815 "buffer is too small (need {} bytes, but got {})",
13816 Self::ENCODED_LEN,
13817 __tmp.remaining(),
13818 )
13819 }
13820 __tmp.put_u64_le(self.time_usec);
13821 __tmp.put_i32_le(self.lat);
13822 __tmp.put_i32_le(self.lon);
13823 __tmp.put_i32_le(self.alt);
13824 __tmp.put_u32_le(self.dgps_age);
13825 __tmp.put_u16_le(self.eph);
13826 __tmp.put_u16_le(self.epv);
13827 __tmp.put_u16_le(self.vel);
13828 __tmp.put_u16_le(self.cog);
13829 __tmp.put_u8(self.fix_type as u8);
13830 __tmp.put_u8(self.satellites_visible);
13831 __tmp.put_u8(self.dgps_numch);
13832 if matches!(version, MavlinkVersion::V2) {
13833 __tmp.put_u16_le(self.yaw);
13834 __tmp.put_i32_le(self.alt_ellipsoid);
13835 __tmp.put_u32_le(self.h_acc);
13836 __tmp.put_u32_le(self.v_acc);
13837 __tmp.put_u32_le(self.vel_acc);
13838 __tmp.put_u32_le(self.hdg_acc);
13839 let len = __tmp.len();
13840 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13841 } else {
13842 __tmp.len()
13843 }
13844 }
13845}
13846#[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
13847#[doc = ""]
13848#[doc = "ID: 128"]
13849#[derive(Debug, Clone, PartialEq)]
13850#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13851#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13852#[cfg_attr(feature = "ts", derive(TS))]
13853#[cfg_attr(feature = "ts", ts(export))]
13854pub struct GPS2_RTK_DATA {
13855 #[doc = "Time since boot of last baseline message received."]
13856 pub time_last_baseline_ms: u32,
13857 #[doc = "GPS Time of Week of last baseline"]
13858 pub tow: u32,
13859 #[doc = "Current baseline in ECEF x or NED north component."]
13860 pub baseline_a_mm: i32,
13861 #[doc = "Current baseline in ECEF y or NED east component."]
13862 pub baseline_b_mm: i32,
13863 #[doc = "Current baseline in ECEF z or NED down component."]
13864 pub baseline_c_mm: i32,
13865 #[doc = "Current estimate of baseline accuracy."]
13866 pub accuracy: u32,
13867 #[doc = "Current number of integer ambiguity hypotheses."]
13868 pub iar_num_hypotheses: i32,
13869 #[doc = "GPS Week Number of last baseline"]
13870 pub wn: u16,
13871 #[doc = "Identification of connected RTK receiver."]
13872 pub rtk_receiver_id: u8,
13873 #[doc = "GPS-specific health report for RTK data."]
13874 pub rtk_health: u8,
13875 #[doc = "Rate of baseline messages being received by GPS"]
13876 pub rtk_rate: u8,
13877 #[doc = "Current number of sats used for RTK calculation."]
13878 pub nsats: u8,
13879 #[doc = "Coordinate system of baseline"]
13880 pub baseline_coords_type: RtkBaselineCoordinateSystem,
13881}
13882impl GPS2_RTK_DATA {
13883 pub const ENCODED_LEN: usize = 35usize;
13884 pub const DEFAULT: Self = Self {
13885 time_last_baseline_ms: 0_u32,
13886 tow: 0_u32,
13887 baseline_a_mm: 0_i32,
13888 baseline_b_mm: 0_i32,
13889 baseline_c_mm: 0_i32,
13890 accuracy: 0_u32,
13891 iar_num_hypotheses: 0_i32,
13892 wn: 0_u16,
13893 rtk_receiver_id: 0_u8,
13894 rtk_health: 0_u8,
13895 rtk_rate: 0_u8,
13896 nsats: 0_u8,
13897 baseline_coords_type: RtkBaselineCoordinateSystem::DEFAULT,
13898 };
13899 #[cfg(feature = "arbitrary")]
13900 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13901 use arbitrary::{Arbitrary, Unstructured};
13902 let mut buf = [0u8; 1024];
13903 rng.fill_bytes(&mut buf);
13904 let mut unstructured = Unstructured::new(&buf);
13905 Self::arbitrary(&mut unstructured).unwrap_or_default()
13906 }
13907}
13908impl Default for GPS2_RTK_DATA {
13909 fn default() -> Self {
13910 Self::DEFAULT.clone()
13911 }
13912}
13913impl MessageData for GPS2_RTK_DATA {
13914 type Message = MavMessage;
13915 const ID: u32 = 128u32;
13916 const NAME: &'static str = "GPS2_RTK";
13917 const EXTRA_CRC: u8 = 226u8;
13918 const ENCODED_LEN: usize = 35usize;
13919 fn deser(
13920 _version: MavlinkVersion,
13921 __input: &[u8],
13922 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13923 let avail_len = __input.len();
13924 let mut payload_buf = [0; Self::ENCODED_LEN];
13925 let mut buf = if avail_len < Self::ENCODED_LEN {
13926 payload_buf[0..avail_len].copy_from_slice(__input);
13927 Bytes::new(&payload_buf)
13928 } else {
13929 Bytes::new(__input)
13930 };
13931 let mut __struct = Self::default();
13932 __struct.time_last_baseline_ms = buf.get_u32_le();
13933 __struct.tow = buf.get_u32_le();
13934 __struct.baseline_a_mm = buf.get_i32_le();
13935 __struct.baseline_b_mm = buf.get_i32_le();
13936 __struct.baseline_c_mm = buf.get_i32_le();
13937 __struct.accuracy = buf.get_u32_le();
13938 __struct.iar_num_hypotheses = buf.get_i32_le();
13939 __struct.wn = buf.get_u16_le();
13940 __struct.rtk_receiver_id = buf.get_u8();
13941 __struct.rtk_health = buf.get_u8();
13942 __struct.rtk_rate = buf.get_u8();
13943 __struct.nsats = buf.get_u8();
13944 let tmp = buf.get_u8();
13945 __struct.baseline_coords_type =
13946 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
13947 enum_type: "RtkBaselineCoordinateSystem",
13948 value: tmp as u64,
13949 })?;
13950 Ok(__struct)
13951 }
13952 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13953 let mut __tmp = BytesMut::new(bytes);
13954 #[allow(clippy::absurd_extreme_comparisons)]
13955 #[allow(unused_comparisons)]
13956 if __tmp.remaining() < Self::ENCODED_LEN {
13957 panic!(
13958 "buffer is too small (need {} bytes, but got {})",
13959 Self::ENCODED_LEN,
13960 __tmp.remaining(),
13961 )
13962 }
13963 __tmp.put_u32_le(self.time_last_baseline_ms);
13964 __tmp.put_u32_le(self.tow);
13965 __tmp.put_i32_le(self.baseline_a_mm);
13966 __tmp.put_i32_le(self.baseline_b_mm);
13967 __tmp.put_i32_le(self.baseline_c_mm);
13968 __tmp.put_u32_le(self.accuracy);
13969 __tmp.put_i32_le(self.iar_num_hypotheses);
13970 __tmp.put_u16_le(self.wn);
13971 __tmp.put_u8(self.rtk_receiver_id);
13972 __tmp.put_u8(self.rtk_health);
13973 __tmp.put_u8(self.rtk_rate);
13974 __tmp.put_u8(self.nsats);
13975 __tmp.put_u8(self.baseline_coords_type as u8);
13976 if matches!(version, MavlinkVersion::V2) {
13977 let len = __tmp.len();
13978 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13979 } else {
13980 __tmp.len()
13981 }
13982 }
13983}
13984#[doc = "Publishes the GPS coordinates of the vehicle local origin (0,0,0) position. Emitted whenever a new GPS-Local position mapping is requested or set - e.g. following SET_GPS_GLOBAL_ORIGIN message."]
13985#[doc = ""]
13986#[doc = "ID: 49"]
13987#[derive(Debug, Clone, PartialEq)]
13988#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13989#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13990#[cfg_attr(feature = "ts", derive(TS))]
13991#[cfg_attr(feature = "ts", ts(export))]
13992pub struct GPS_GLOBAL_ORIGIN_DATA {
13993 #[doc = "Latitude (WGS84)"]
13994 pub latitude: i32,
13995 #[doc = "Longitude (WGS84)"]
13996 pub longitude: i32,
13997 #[doc = "Altitude (MSL). Positive for up."]
13998 pub altitude: i32,
13999 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14000 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14001 pub time_usec: u64,
14002}
14003impl GPS_GLOBAL_ORIGIN_DATA {
14004 pub const ENCODED_LEN: usize = 20usize;
14005 pub const DEFAULT: Self = Self {
14006 latitude: 0_i32,
14007 longitude: 0_i32,
14008 altitude: 0_i32,
14009 time_usec: 0_u64,
14010 };
14011 #[cfg(feature = "arbitrary")]
14012 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14013 use arbitrary::{Arbitrary, Unstructured};
14014 let mut buf = [0u8; 1024];
14015 rng.fill_bytes(&mut buf);
14016 let mut unstructured = Unstructured::new(&buf);
14017 Self::arbitrary(&mut unstructured).unwrap_or_default()
14018 }
14019}
14020impl Default for GPS_GLOBAL_ORIGIN_DATA {
14021 fn default() -> Self {
14022 Self::DEFAULT.clone()
14023 }
14024}
14025impl MessageData for GPS_GLOBAL_ORIGIN_DATA {
14026 type Message = MavMessage;
14027 const ID: u32 = 49u32;
14028 const NAME: &'static str = "GPS_GLOBAL_ORIGIN";
14029 const EXTRA_CRC: u8 = 39u8;
14030 const ENCODED_LEN: usize = 20usize;
14031 fn deser(
14032 _version: MavlinkVersion,
14033 __input: &[u8],
14034 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14035 let avail_len = __input.len();
14036 let mut payload_buf = [0; Self::ENCODED_LEN];
14037 let mut buf = if avail_len < Self::ENCODED_LEN {
14038 payload_buf[0..avail_len].copy_from_slice(__input);
14039 Bytes::new(&payload_buf)
14040 } else {
14041 Bytes::new(__input)
14042 };
14043 let mut __struct = Self::default();
14044 __struct.latitude = buf.get_i32_le();
14045 __struct.longitude = buf.get_i32_le();
14046 __struct.altitude = buf.get_i32_le();
14047 __struct.time_usec = buf.get_u64_le();
14048 Ok(__struct)
14049 }
14050 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14051 let mut __tmp = BytesMut::new(bytes);
14052 #[allow(clippy::absurd_extreme_comparisons)]
14053 #[allow(unused_comparisons)]
14054 if __tmp.remaining() < Self::ENCODED_LEN {
14055 panic!(
14056 "buffer is too small (need {} bytes, but got {})",
14057 Self::ENCODED_LEN,
14058 __tmp.remaining(),
14059 )
14060 }
14061 __tmp.put_i32_le(self.latitude);
14062 __tmp.put_i32_le(self.longitude);
14063 __tmp.put_i32_le(self.altitude);
14064 if matches!(version, MavlinkVersion::V2) {
14065 __tmp.put_u64_le(self.time_usec);
14066 let len = __tmp.len();
14067 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14068 } else {
14069 __tmp.len()
14070 }
14071 }
14072}
14073#[deprecated = " See `GPS_RTCM_DATA` (Deprecated since 2022-05)"]
14074#[doc = "Data for injecting into the onboard GPS (used for DGPS)."]
14075#[doc = ""]
14076#[doc = "ID: 123"]
14077#[derive(Debug, Clone, PartialEq)]
14078#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14079#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14080#[cfg_attr(feature = "ts", derive(TS))]
14081#[cfg_attr(feature = "ts", ts(export))]
14082pub struct GPS_INJECT_DATA_DATA {
14083 #[doc = "System ID"]
14084 pub target_system: u8,
14085 #[doc = "Component ID"]
14086 pub target_component: u8,
14087 #[doc = "Data length"]
14088 pub len: u8,
14089 #[doc = "Raw data (110 is enough for 12 satellites of RTCMv2)"]
14090 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14091 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14092 pub data: [u8; 110],
14093}
14094impl GPS_INJECT_DATA_DATA {
14095 pub const ENCODED_LEN: usize = 113usize;
14096 pub const DEFAULT: Self = Self {
14097 target_system: 0_u8,
14098 target_component: 0_u8,
14099 len: 0_u8,
14100 data: [0_u8; 110usize],
14101 };
14102 #[cfg(feature = "arbitrary")]
14103 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14104 use arbitrary::{Arbitrary, Unstructured};
14105 let mut buf = [0u8; 1024];
14106 rng.fill_bytes(&mut buf);
14107 let mut unstructured = Unstructured::new(&buf);
14108 Self::arbitrary(&mut unstructured).unwrap_or_default()
14109 }
14110}
14111impl Default for GPS_INJECT_DATA_DATA {
14112 fn default() -> Self {
14113 Self::DEFAULT.clone()
14114 }
14115}
14116impl MessageData for GPS_INJECT_DATA_DATA {
14117 type Message = MavMessage;
14118 const ID: u32 = 123u32;
14119 const NAME: &'static str = "GPS_INJECT_DATA";
14120 const EXTRA_CRC: u8 = 250u8;
14121 const ENCODED_LEN: usize = 113usize;
14122 fn deser(
14123 _version: MavlinkVersion,
14124 __input: &[u8],
14125 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14126 let avail_len = __input.len();
14127 let mut payload_buf = [0; Self::ENCODED_LEN];
14128 let mut buf = if avail_len < Self::ENCODED_LEN {
14129 payload_buf[0..avail_len].copy_from_slice(__input);
14130 Bytes::new(&payload_buf)
14131 } else {
14132 Bytes::new(__input)
14133 };
14134 let mut __struct = Self::default();
14135 __struct.target_system = buf.get_u8();
14136 __struct.target_component = buf.get_u8();
14137 __struct.len = buf.get_u8();
14138 for v in &mut __struct.data {
14139 let val = buf.get_u8();
14140 *v = val;
14141 }
14142 Ok(__struct)
14143 }
14144 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14145 let mut __tmp = BytesMut::new(bytes);
14146 #[allow(clippy::absurd_extreme_comparisons)]
14147 #[allow(unused_comparisons)]
14148 if __tmp.remaining() < Self::ENCODED_LEN {
14149 panic!(
14150 "buffer is too small (need {} bytes, but got {})",
14151 Self::ENCODED_LEN,
14152 __tmp.remaining(),
14153 )
14154 }
14155 __tmp.put_u8(self.target_system);
14156 __tmp.put_u8(self.target_component);
14157 __tmp.put_u8(self.len);
14158 for val in &self.data {
14159 __tmp.put_u8(*val);
14160 }
14161 if matches!(version, MavlinkVersion::V2) {
14162 let len = __tmp.len();
14163 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14164 } else {
14165 __tmp.len()
14166 }
14167 }
14168}
14169#[doc = "GPS sensor input message. This is a raw sensor value sent by the GPS. This is NOT the global position estimate of the system."]
14170#[doc = ""]
14171#[doc = "ID: 232"]
14172#[derive(Debug, Clone, PartialEq)]
14173#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14174#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14175#[cfg_attr(feature = "ts", derive(TS))]
14176#[cfg_attr(feature = "ts", ts(export))]
14177pub struct GPS_INPUT_DATA {
14178 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14179 pub time_usec: u64,
14180 #[doc = "GPS time (from start of GPS week)"]
14181 pub time_week_ms: u32,
14182 #[doc = "Latitude (WGS84)"]
14183 pub lat: i32,
14184 #[doc = "Longitude (WGS84)"]
14185 pub lon: i32,
14186 #[doc = "Altitude (MSL). Positive for up."]
14187 pub alt: f32,
14188 #[doc = "GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX"]
14189 pub hdop: f32,
14190 #[doc = "GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX"]
14191 pub vdop: f32,
14192 #[doc = "GPS velocity in north direction in earth-fixed NED frame"]
14193 pub vn: f32,
14194 #[doc = "GPS velocity in east direction in earth-fixed NED frame"]
14195 pub ve: f32,
14196 #[doc = "GPS velocity in down direction in earth-fixed NED frame"]
14197 pub vd: f32,
14198 #[doc = "GPS speed accuracy"]
14199 pub speed_accuracy: f32,
14200 #[doc = "GPS horizontal accuracy"]
14201 pub horiz_accuracy: f32,
14202 #[doc = "GPS vertical accuracy"]
14203 pub vert_accuracy: f32,
14204 #[doc = "Bitmap indicating which GPS input flags fields to ignore. All other fields must be provided."]
14205 pub ignore_flags: GpsInputIgnoreFlags,
14206 #[doc = "GPS week number"]
14207 pub time_week: u16,
14208 #[doc = "ID of the GPS for multiple GPS inputs"]
14209 pub gps_id: u8,
14210 #[doc = "0-1: no fix, 2: 2D fix, 3: 3D fix. 4: 3D with DGPS. 5: 3D with RTK"]
14211 pub fix_type: u8,
14212 #[doc = "Number of satellites visible."]
14213 pub satellites_visible: u8,
14214 #[doc = "Yaw of vehicle relative to Earth's North, zero means not available, use 36000 for north"]
14215 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14216 pub yaw: u16,
14217}
14218impl GPS_INPUT_DATA {
14219 pub const ENCODED_LEN: usize = 65usize;
14220 pub const DEFAULT: Self = Self {
14221 time_usec: 0_u64,
14222 time_week_ms: 0_u32,
14223 lat: 0_i32,
14224 lon: 0_i32,
14225 alt: 0.0_f32,
14226 hdop: 0.0_f32,
14227 vdop: 0.0_f32,
14228 vn: 0.0_f32,
14229 ve: 0.0_f32,
14230 vd: 0.0_f32,
14231 speed_accuracy: 0.0_f32,
14232 horiz_accuracy: 0.0_f32,
14233 vert_accuracy: 0.0_f32,
14234 ignore_flags: GpsInputIgnoreFlags::DEFAULT,
14235 time_week: 0_u16,
14236 gps_id: 0_u8,
14237 fix_type: 0_u8,
14238 satellites_visible: 0_u8,
14239 yaw: 0_u16,
14240 };
14241 #[cfg(feature = "arbitrary")]
14242 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14243 use arbitrary::{Arbitrary, Unstructured};
14244 let mut buf = [0u8; 1024];
14245 rng.fill_bytes(&mut buf);
14246 let mut unstructured = Unstructured::new(&buf);
14247 Self::arbitrary(&mut unstructured).unwrap_or_default()
14248 }
14249}
14250impl Default for GPS_INPUT_DATA {
14251 fn default() -> Self {
14252 Self::DEFAULT.clone()
14253 }
14254}
14255impl MessageData for GPS_INPUT_DATA {
14256 type Message = MavMessage;
14257 const ID: u32 = 232u32;
14258 const NAME: &'static str = "GPS_INPUT";
14259 const EXTRA_CRC: u8 = 151u8;
14260 const ENCODED_LEN: usize = 65usize;
14261 fn deser(
14262 _version: MavlinkVersion,
14263 __input: &[u8],
14264 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14265 let avail_len = __input.len();
14266 let mut payload_buf = [0; Self::ENCODED_LEN];
14267 let mut buf = if avail_len < Self::ENCODED_LEN {
14268 payload_buf[0..avail_len].copy_from_slice(__input);
14269 Bytes::new(&payload_buf)
14270 } else {
14271 Bytes::new(__input)
14272 };
14273 let mut __struct = Self::default();
14274 __struct.time_usec = buf.get_u64_le();
14275 __struct.time_week_ms = buf.get_u32_le();
14276 __struct.lat = buf.get_i32_le();
14277 __struct.lon = buf.get_i32_le();
14278 __struct.alt = buf.get_f32_le();
14279 __struct.hdop = buf.get_f32_le();
14280 __struct.vdop = buf.get_f32_le();
14281 __struct.vn = buf.get_f32_le();
14282 __struct.ve = buf.get_f32_le();
14283 __struct.vd = buf.get_f32_le();
14284 __struct.speed_accuracy = buf.get_f32_le();
14285 __struct.horiz_accuracy = buf.get_f32_le();
14286 __struct.vert_accuracy = buf.get_f32_le();
14287 let tmp = buf.get_u16_le();
14288 __struct.ignore_flags = GpsInputIgnoreFlags::from_bits(tmp).ok_or(
14289 ::mavlink_core::error::ParserError::InvalidFlag {
14290 flag_type: "GpsInputIgnoreFlags",
14291 value: tmp as u64,
14292 },
14293 )?;
14294 __struct.time_week = buf.get_u16_le();
14295 __struct.gps_id = buf.get_u8();
14296 __struct.fix_type = buf.get_u8();
14297 __struct.satellites_visible = buf.get_u8();
14298 __struct.yaw = buf.get_u16_le();
14299 Ok(__struct)
14300 }
14301 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14302 let mut __tmp = BytesMut::new(bytes);
14303 #[allow(clippy::absurd_extreme_comparisons)]
14304 #[allow(unused_comparisons)]
14305 if __tmp.remaining() < Self::ENCODED_LEN {
14306 panic!(
14307 "buffer is too small (need {} bytes, but got {})",
14308 Self::ENCODED_LEN,
14309 __tmp.remaining(),
14310 )
14311 }
14312 __tmp.put_u64_le(self.time_usec);
14313 __tmp.put_u32_le(self.time_week_ms);
14314 __tmp.put_i32_le(self.lat);
14315 __tmp.put_i32_le(self.lon);
14316 __tmp.put_f32_le(self.alt);
14317 __tmp.put_f32_le(self.hdop);
14318 __tmp.put_f32_le(self.vdop);
14319 __tmp.put_f32_le(self.vn);
14320 __tmp.put_f32_le(self.ve);
14321 __tmp.put_f32_le(self.vd);
14322 __tmp.put_f32_le(self.speed_accuracy);
14323 __tmp.put_f32_le(self.horiz_accuracy);
14324 __tmp.put_f32_le(self.vert_accuracy);
14325 __tmp.put_u16_le(self.ignore_flags.bits());
14326 __tmp.put_u16_le(self.time_week);
14327 __tmp.put_u8(self.gps_id);
14328 __tmp.put_u8(self.fix_type);
14329 __tmp.put_u8(self.satellites_visible);
14330 if matches!(version, MavlinkVersion::V2) {
14331 __tmp.put_u16_le(self.yaw);
14332 let len = __tmp.len();
14333 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14334 } else {
14335 __tmp.len()
14336 }
14337 }
14338}
14339#[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
14340#[doc = ""]
14341#[doc = "ID: 24"]
14342#[derive(Debug, Clone, PartialEq)]
14343#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14344#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14345#[cfg_attr(feature = "ts", derive(TS))]
14346#[cfg_attr(feature = "ts", ts(export))]
14347pub struct GPS_RAW_INT_DATA {
14348 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14349 pub time_usec: u64,
14350 #[doc = "Latitude (WGS84, EGM96 ellipsoid)"]
14351 pub lat: i32,
14352 #[doc = "Longitude (WGS84, EGM96 ellipsoid)"]
14353 pub lon: i32,
14354 #[doc = "Altitude (MSL). Positive for up. Note that virtually all GPS modules provide the MSL altitude in addition to the WGS84 altitude."]
14355 pub alt: i32,
14356 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
14357 pub eph: u16,
14358 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
14359 pub epv: u16,
14360 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
14361 pub vel: u16,
14362 #[doc = "Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
14363 pub cog: u16,
14364 #[doc = "GPS fix type."]
14365 pub fix_type: GpsFixType,
14366 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
14367 pub satellites_visible: u8,
14368 #[doc = "Altitude (above WGS84, EGM96 ellipsoid). Positive for up."]
14369 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14370 pub alt_ellipsoid: i32,
14371 #[doc = "Position uncertainty."]
14372 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14373 pub h_acc: u32,
14374 #[doc = "Altitude uncertainty."]
14375 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14376 pub v_acc: u32,
14377 #[doc = "Speed uncertainty."]
14378 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14379 pub vel_acc: u32,
14380 #[doc = "Heading / track uncertainty"]
14381 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14382 pub hdg_acc: u32,
14383 #[doc = "Yaw in earth frame from north. Use 0 if this GPS does not provide yaw. Use UINT16_MAX if this GPS is configured to provide yaw and is currently unable to provide it. Use 36000 for north."]
14384 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14385 pub yaw: u16,
14386}
14387impl GPS_RAW_INT_DATA {
14388 pub const ENCODED_LEN: usize = 52usize;
14389 pub const DEFAULT: Self = Self {
14390 time_usec: 0_u64,
14391 lat: 0_i32,
14392 lon: 0_i32,
14393 alt: 0_i32,
14394 eph: 0_u16,
14395 epv: 0_u16,
14396 vel: 0_u16,
14397 cog: 0_u16,
14398 fix_type: GpsFixType::DEFAULT,
14399 satellites_visible: 0_u8,
14400 alt_ellipsoid: 0_i32,
14401 h_acc: 0_u32,
14402 v_acc: 0_u32,
14403 vel_acc: 0_u32,
14404 hdg_acc: 0_u32,
14405 yaw: 0_u16,
14406 };
14407 #[cfg(feature = "arbitrary")]
14408 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14409 use arbitrary::{Arbitrary, Unstructured};
14410 let mut buf = [0u8; 1024];
14411 rng.fill_bytes(&mut buf);
14412 let mut unstructured = Unstructured::new(&buf);
14413 Self::arbitrary(&mut unstructured).unwrap_or_default()
14414 }
14415}
14416impl Default for GPS_RAW_INT_DATA {
14417 fn default() -> Self {
14418 Self::DEFAULT.clone()
14419 }
14420}
14421impl MessageData for GPS_RAW_INT_DATA {
14422 type Message = MavMessage;
14423 const ID: u32 = 24u32;
14424 const NAME: &'static str = "GPS_RAW_INT";
14425 const EXTRA_CRC: u8 = 24u8;
14426 const ENCODED_LEN: usize = 52usize;
14427 fn deser(
14428 _version: MavlinkVersion,
14429 __input: &[u8],
14430 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14431 let avail_len = __input.len();
14432 let mut payload_buf = [0; Self::ENCODED_LEN];
14433 let mut buf = if avail_len < Self::ENCODED_LEN {
14434 payload_buf[0..avail_len].copy_from_slice(__input);
14435 Bytes::new(&payload_buf)
14436 } else {
14437 Bytes::new(__input)
14438 };
14439 let mut __struct = Self::default();
14440 __struct.time_usec = buf.get_u64_le();
14441 __struct.lat = buf.get_i32_le();
14442 __struct.lon = buf.get_i32_le();
14443 __struct.alt = buf.get_i32_le();
14444 __struct.eph = buf.get_u16_le();
14445 __struct.epv = buf.get_u16_le();
14446 __struct.vel = buf.get_u16_le();
14447 __struct.cog = buf.get_u16_le();
14448 let tmp = buf.get_u8();
14449 __struct.fix_type =
14450 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14451 enum_type: "GpsFixType",
14452 value: tmp as u64,
14453 })?;
14454 __struct.satellites_visible = buf.get_u8();
14455 __struct.alt_ellipsoid = buf.get_i32_le();
14456 __struct.h_acc = buf.get_u32_le();
14457 __struct.v_acc = buf.get_u32_le();
14458 __struct.vel_acc = buf.get_u32_le();
14459 __struct.hdg_acc = buf.get_u32_le();
14460 __struct.yaw = buf.get_u16_le();
14461 Ok(__struct)
14462 }
14463 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14464 let mut __tmp = BytesMut::new(bytes);
14465 #[allow(clippy::absurd_extreme_comparisons)]
14466 #[allow(unused_comparisons)]
14467 if __tmp.remaining() < Self::ENCODED_LEN {
14468 panic!(
14469 "buffer is too small (need {} bytes, but got {})",
14470 Self::ENCODED_LEN,
14471 __tmp.remaining(),
14472 )
14473 }
14474 __tmp.put_u64_le(self.time_usec);
14475 __tmp.put_i32_le(self.lat);
14476 __tmp.put_i32_le(self.lon);
14477 __tmp.put_i32_le(self.alt);
14478 __tmp.put_u16_le(self.eph);
14479 __tmp.put_u16_le(self.epv);
14480 __tmp.put_u16_le(self.vel);
14481 __tmp.put_u16_le(self.cog);
14482 __tmp.put_u8(self.fix_type as u8);
14483 __tmp.put_u8(self.satellites_visible);
14484 if matches!(version, MavlinkVersion::V2) {
14485 __tmp.put_i32_le(self.alt_ellipsoid);
14486 __tmp.put_u32_le(self.h_acc);
14487 __tmp.put_u32_le(self.v_acc);
14488 __tmp.put_u32_le(self.vel_acc);
14489 __tmp.put_u32_le(self.hdg_acc);
14490 __tmp.put_u16_le(self.yaw);
14491 let len = __tmp.len();
14492 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14493 } else {
14494 __tmp.len()
14495 }
14496 }
14497}
14498#[doc = "RTCM message for injecting into the onboard GPS (used for DGPS)."]
14499#[doc = ""]
14500#[doc = "ID: 233"]
14501#[derive(Debug, Clone, PartialEq)]
14502#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14503#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14504#[cfg_attr(feature = "ts", derive(TS))]
14505#[cfg_attr(feature = "ts", ts(export))]
14506pub struct GPS_RTCM_DATA_DATA {
14507 #[doc = "LSB: 1 means message is fragmented, next 2 bits are the fragment ID, the remaining 5 bits are used for the sequence ID. Messages are only to be flushed to the GPS when the entire message has been reconstructed on the autopilot. The fragment ID specifies which order the fragments should be assembled into a buffer, while the sequence ID is used to detect a mismatch between different buffers. The buffer is considered fully reconstructed when either all 4 fragments are present, or all the fragments before the first fragment with a non full payload is received. This management is used to ensure that normal GPS operation doesn't corrupt RTCM data, and to recover from a unreliable transport delivery order."]
14508 pub flags: u8,
14509 #[doc = "data length"]
14510 pub len: u8,
14511 #[doc = "RTCM message (may be fragmented)"]
14512 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14513 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14514 pub data: [u8; 180],
14515}
14516impl GPS_RTCM_DATA_DATA {
14517 pub const ENCODED_LEN: usize = 182usize;
14518 pub const DEFAULT: Self = Self {
14519 flags: 0_u8,
14520 len: 0_u8,
14521 data: [0_u8; 180usize],
14522 };
14523 #[cfg(feature = "arbitrary")]
14524 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14525 use arbitrary::{Arbitrary, Unstructured};
14526 let mut buf = [0u8; 1024];
14527 rng.fill_bytes(&mut buf);
14528 let mut unstructured = Unstructured::new(&buf);
14529 Self::arbitrary(&mut unstructured).unwrap_or_default()
14530 }
14531}
14532impl Default for GPS_RTCM_DATA_DATA {
14533 fn default() -> Self {
14534 Self::DEFAULT.clone()
14535 }
14536}
14537impl MessageData for GPS_RTCM_DATA_DATA {
14538 type Message = MavMessage;
14539 const ID: u32 = 233u32;
14540 const NAME: &'static str = "GPS_RTCM_DATA";
14541 const EXTRA_CRC: u8 = 35u8;
14542 const ENCODED_LEN: usize = 182usize;
14543 fn deser(
14544 _version: MavlinkVersion,
14545 __input: &[u8],
14546 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14547 let avail_len = __input.len();
14548 let mut payload_buf = [0; Self::ENCODED_LEN];
14549 let mut buf = if avail_len < Self::ENCODED_LEN {
14550 payload_buf[0..avail_len].copy_from_slice(__input);
14551 Bytes::new(&payload_buf)
14552 } else {
14553 Bytes::new(__input)
14554 };
14555 let mut __struct = Self::default();
14556 __struct.flags = buf.get_u8();
14557 __struct.len = buf.get_u8();
14558 for v in &mut __struct.data {
14559 let val = buf.get_u8();
14560 *v = val;
14561 }
14562 Ok(__struct)
14563 }
14564 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14565 let mut __tmp = BytesMut::new(bytes);
14566 #[allow(clippy::absurd_extreme_comparisons)]
14567 #[allow(unused_comparisons)]
14568 if __tmp.remaining() < Self::ENCODED_LEN {
14569 panic!(
14570 "buffer is too small (need {} bytes, but got {})",
14571 Self::ENCODED_LEN,
14572 __tmp.remaining(),
14573 )
14574 }
14575 __tmp.put_u8(self.flags);
14576 __tmp.put_u8(self.len);
14577 for val in &self.data {
14578 __tmp.put_u8(*val);
14579 }
14580 if matches!(version, MavlinkVersion::V2) {
14581 let len = __tmp.len();
14582 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14583 } else {
14584 __tmp.len()
14585 }
14586 }
14587}
14588#[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
14589#[doc = ""]
14590#[doc = "ID: 127"]
14591#[derive(Debug, Clone, PartialEq)]
14592#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14593#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14594#[cfg_attr(feature = "ts", derive(TS))]
14595#[cfg_attr(feature = "ts", ts(export))]
14596pub struct GPS_RTK_DATA {
14597 #[doc = "Time since boot of last baseline message received."]
14598 pub time_last_baseline_ms: u32,
14599 #[doc = "GPS Time of Week of last baseline"]
14600 pub tow: u32,
14601 #[doc = "Current baseline in ECEF x or NED north component."]
14602 pub baseline_a_mm: i32,
14603 #[doc = "Current baseline in ECEF y or NED east component."]
14604 pub baseline_b_mm: i32,
14605 #[doc = "Current baseline in ECEF z or NED down component."]
14606 pub baseline_c_mm: i32,
14607 #[doc = "Current estimate of baseline accuracy."]
14608 pub accuracy: u32,
14609 #[doc = "Current number of integer ambiguity hypotheses."]
14610 pub iar_num_hypotheses: i32,
14611 #[doc = "GPS Week Number of last baseline"]
14612 pub wn: u16,
14613 #[doc = "Identification of connected RTK receiver."]
14614 pub rtk_receiver_id: u8,
14615 #[doc = "GPS-specific health report for RTK data."]
14616 pub rtk_health: u8,
14617 #[doc = "Rate of baseline messages being received by GPS"]
14618 pub rtk_rate: u8,
14619 #[doc = "Current number of sats used for RTK calculation."]
14620 pub nsats: u8,
14621 #[doc = "Coordinate system of baseline"]
14622 pub baseline_coords_type: RtkBaselineCoordinateSystem,
14623}
14624impl GPS_RTK_DATA {
14625 pub const ENCODED_LEN: usize = 35usize;
14626 pub const DEFAULT: Self = Self {
14627 time_last_baseline_ms: 0_u32,
14628 tow: 0_u32,
14629 baseline_a_mm: 0_i32,
14630 baseline_b_mm: 0_i32,
14631 baseline_c_mm: 0_i32,
14632 accuracy: 0_u32,
14633 iar_num_hypotheses: 0_i32,
14634 wn: 0_u16,
14635 rtk_receiver_id: 0_u8,
14636 rtk_health: 0_u8,
14637 rtk_rate: 0_u8,
14638 nsats: 0_u8,
14639 baseline_coords_type: RtkBaselineCoordinateSystem::DEFAULT,
14640 };
14641 #[cfg(feature = "arbitrary")]
14642 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14643 use arbitrary::{Arbitrary, Unstructured};
14644 let mut buf = [0u8; 1024];
14645 rng.fill_bytes(&mut buf);
14646 let mut unstructured = Unstructured::new(&buf);
14647 Self::arbitrary(&mut unstructured).unwrap_or_default()
14648 }
14649}
14650impl Default for GPS_RTK_DATA {
14651 fn default() -> Self {
14652 Self::DEFAULT.clone()
14653 }
14654}
14655impl MessageData for GPS_RTK_DATA {
14656 type Message = MavMessage;
14657 const ID: u32 = 127u32;
14658 const NAME: &'static str = "GPS_RTK";
14659 const EXTRA_CRC: u8 = 25u8;
14660 const ENCODED_LEN: usize = 35usize;
14661 fn deser(
14662 _version: MavlinkVersion,
14663 __input: &[u8],
14664 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14665 let avail_len = __input.len();
14666 let mut payload_buf = [0; Self::ENCODED_LEN];
14667 let mut buf = if avail_len < Self::ENCODED_LEN {
14668 payload_buf[0..avail_len].copy_from_slice(__input);
14669 Bytes::new(&payload_buf)
14670 } else {
14671 Bytes::new(__input)
14672 };
14673 let mut __struct = Self::default();
14674 __struct.time_last_baseline_ms = buf.get_u32_le();
14675 __struct.tow = buf.get_u32_le();
14676 __struct.baseline_a_mm = buf.get_i32_le();
14677 __struct.baseline_b_mm = buf.get_i32_le();
14678 __struct.baseline_c_mm = buf.get_i32_le();
14679 __struct.accuracy = buf.get_u32_le();
14680 __struct.iar_num_hypotheses = buf.get_i32_le();
14681 __struct.wn = buf.get_u16_le();
14682 __struct.rtk_receiver_id = buf.get_u8();
14683 __struct.rtk_health = buf.get_u8();
14684 __struct.rtk_rate = buf.get_u8();
14685 __struct.nsats = buf.get_u8();
14686 let tmp = buf.get_u8();
14687 __struct.baseline_coords_type =
14688 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14689 enum_type: "RtkBaselineCoordinateSystem",
14690 value: tmp as u64,
14691 })?;
14692 Ok(__struct)
14693 }
14694 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14695 let mut __tmp = BytesMut::new(bytes);
14696 #[allow(clippy::absurd_extreme_comparisons)]
14697 #[allow(unused_comparisons)]
14698 if __tmp.remaining() < Self::ENCODED_LEN {
14699 panic!(
14700 "buffer is too small (need {} bytes, but got {})",
14701 Self::ENCODED_LEN,
14702 __tmp.remaining(),
14703 )
14704 }
14705 __tmp.put_u32_le(self.time_last_baseline_ms);
14706 __tmp.put_u32_le(self.tow);
14707 __tmp.put_i32_le(self.baseline_a_mm);
14708 __tmp.put_i32_le(self.baseline_b_mm);
14709 __tmp.put_i32_le(self.baseline_c_mm);
14710 __tmp.put_u32_le(self.accuracy);
14711 __tmp.put_i32_le(self.iar_num_hypotheses);
14712 __tmp.put_u16_le(self.wn);
14713 __tmp.put_u8(self.rtk_receiver_id);
14714 __tmp.put_u8(self.rtk_health);
14715 __tmp.put_u8(self.rtk_rate);
14716 __tmp.put_u8(self.nsats);
14717 __tmp.put_u8(self.baseline_coords_type as u8);
14718 if matches!(version, MavlinkVersion::V2) {
14719 let len = __tmp.len();
14720 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14721 } else {
14722 __tmp.len()
14723 }
14724 }
14725}
14726#[doc = "The positioning status, as reported by GPS. This message is intended to display status information about each satellite visible to the receiver. See message GLOBAL_POSITION_INT for the global position estimate. This message can contain information for up to 20 satellites."]
14727#[doc = ""]
14728#[doc = "ID: 25"]
14729#[derive(Debug, Clone, PartialEq)]
14730#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14731#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14732#[cfg_attr(feature = "ts", derive(TS))]
14733#[cfg_attr(feature = "ts", ts(export))]
14734pub struct GPS_STATUS_DATA {
14735 #[doc = "Number of satellites visible"]
14736 pub satellites_visible: u8,
14737 #[doc = "Global satellite ID"]
14738 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14739 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14740 pub satellite_prn: [u8; 20],
14741 #[doc = "0: Satellite not used, 1: used for localization"]
14742 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14743 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14744 pub satellite_used: [u8; 20],
14745 #[doc = "Elevation (0: right on top of receiver, 90: on the horizon) of satellite"]
14746 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14747 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14748 pub satellite_elevation: [u8; 20],
14749 #[doc = "Direction of satellite, 0: 0 deg, 255: 360 deg."]
14750 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14751 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14752 pub satellite_azimuth: [u8; 20],
14753 #[doc = "Signal to noise ratio of satellite"]
14754 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14755 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14756 pub satellite_snr: [u8; 20],
14757}
14758impl GPS_STATUS_DATA {
14759 pub const ENCODED_LEN: usize = 101usize;
14760 pub const DEFAULT: Self = Self {
14761 satellites_visible: 0_u8,
14762 satellite_prn: [0_u8; 20usize],
14763 satellite_used: [0_u8; 20usize],
14764 satellite_elevation: [0_u8; 20usize],
14765 satellite_azimuth: [0_u8; 20usize],
14766 satellite_snr: [0_u8; 20usize],
14767 };
14768 #[cfg(feature = "arbitrary")]
14769 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14770 use arbitrary::{Arbitrary, Unstructured};
14771 let mut buf = [0u8; 1024];
14772 rng.fill_bytes(&mut buf);
14773 let mut unstructured = Unstructured::new(&buf);
14774 Self::arbitrary(&mut unstructured).unwrap_or_default()
14775 }
14776}
14777impl Default for GPS_STATUS_DATA {
14778 fn default() -> Self {
14779 Self::DEFAULT.clone()
14780 }
14781}
14782impl MessageData for GPS_STATUS_DATA {
14783 type Message = MavMessage;
14784 const ID: u32 = 25u32;
14785 const NAME: &'static str = "GPS_STATUS";
14786 const EXTRA_CRC: u8 = 23u8;
14787 const ENCODED_LEN: usize = 101usize;
14788 fn deser(
14789 _version: MavlinkVersion,
14790 __input: &[u8],
14791 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14792 let avail_len = __input.len();
14793 let mut payload_buf = [0; Self::ENCODED_LEN];
14794 let mut buf = if avail_len < Self::ENCODED_LEN {
14795 payload_buf[0..avail_len].copy_from_slice(__input);
14796 Bytes::new(&payload_buf)
14797 } else {
14798 Bytes::new(__input)
14799 };
14800 let mut __struct = Self::default();
14801 __struct.satellites_visible = buf.get_u8();
14802 for v in &mut __struct.satellite_prn {
14803 let val = buf.get_u8();
14804 *v = val;
14805 }
14806 for v in &mut __struct.satellite_used {
14807 let val = buf.get_u8();
14808 *v = val;
14809 }
14810 for v in &mut __struct.satellite_elevation {
14811 let val = buf.get_u8();
14812 *v = val;
14813 }
14814 for v in &mut __struct.satellite_azimuth {
14815 let val = buf.get_u8();
14816 *v = val;
14817 }
14818 for v in &mut __struct.satellite_snr {
14819 let val = buf.get_u8();
14820 *v = val;
14821 }
14822 Ok(__struct)
14823 }
14824 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14825 let mut __tmp = BytesMut::new(bytes);
14826 #[allow(clippy::absurd_extreme_comparisons)]
14827 #[allow(unused_comparisons)]
14828 if __tmp.remaining() < Self::ENCODED_LEN {
14829 panic!(
14830 "buffer is too small (need {} bytes, but got {})",
14831 Self::ENCODED_LEN,
14832 __tmp.remaining(),
14833 )
14834 }
14835 __tmp.put_u8(self.satellites_visible);
14836 for val in &self.satellite_prn {
14837 __tmp.put_u8(*val);
14838 }
14839 for val in &self.satellite_used {
14840 __tmp.put_u8(*val);
14841 }
14842 for val in &self.satellite_elevation {
14843 __tmp.put_u8(*val);
14844 }
14845 for val in &self.satellite_azimuth {
14846 __tmp.put_u8(*val);
14847 }
14848 for val in &self.satellite_snr {
14849 __tmp.put_u8(*val);
14850 }
14851 if matches!(version, MavlinkVersion::V2) {
14852 let len = __tmp.len();
14853 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14854 } else {
14855 __tmp.len()
14856 }
14857 }
14858}
14859#[doc = "The heartbeat message shows that a system or component is present and responding. The type and autopilot fields (along with the message component id), allow the receiving system to treat further messages from this system appropriately (e.g. by laying out the user interface based on the autopilot). This microservice is documented at <https://mavlink.io/en/services/heartbeat.html>."]
14860#[doc = ""]
14861#[doc = "ID: 0"]
14862#[derive(Debug, Clone, PartialEq)]
14863#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14864#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14865#[cfg_attr(feature = "ts", derive(TS))]
14866#[cfg_attr(feature = "ts", ts(export))]
14867pub struct HEARTBEAT_DATA {
14868 #[doc = "A bitfield for use for autopilot-specific flags"]
14869 pub custom_mode: u32,
14870 #[doc = "Vehicle or component type. For a flight controller component the vehicle type (quadrotor, helicopter, etc.). For other components the component type (e.g. camera, gimbal, etc.). This should be used in preference to component id for identifying the component type."]
14871 pub mavtype: MavType,
14872 #[doc = "Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers."]
14873 pub autopilot: MavAutopilot,
14874 #[doc = "System mode bitmap."]
14875 pub base_mode: MavModeFlag,
14876 #[doc = "System status flag."]
14877 pub system_status: MavState,
14878 #[doc = "MAVLink version, not writable by user, gets added by protocol because of magic data type: uint8_t_mavlink_version"]
14879 pub mavlink_version: u8,
14880}
14881impl HEARTBEAT_DATA {
14882 pub const ENCODED_LEN: usize = 9usize;
14883 pub const DEFAULT: Self = Self {
14884 custom_mode: 0_u32,
14885 mavtype: MavType::DEFAULT,
14886 autopilot: MavAutopilot::DEFAULT,
14887 base_mode: MavModeFlag::DEFAULT,
14888 system_status: MavState::DEFAULT,
14889 mavlink_version: MINOR_MAVLINK_VERSION,
14890 };
14891 #[cfg(feature = "arbitrary")]
14892 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14893 use arbitrary::{Arbitrary, Unstructured};
14894 let mut buf = [0u8; 1024];
14895 rng.fill_bytes(&mut buf);
14896 let mut unstructured = Unstructured::new(&buf);
14897 Self::arbitrary(&mut unstructured).unwrap_or_default()
14898 }
14899}
14900impl Default for HEARTBEAT_DATA {
14901 fn default() -> Self {
14902 Self::DEFAULT.clone()
14903 }
14904}
14905impl MessageData for HEARTBEAT_DATA {
14906 type Message = MavMessage;
14907 const ID: u32 = 0u32;
14908 const NAME: &'static str = "HEARTBEAT";
14909 const EXTRA_CRC: u8 = 50u8;
14910 const ENCODED_LEN: usize = 9usize;
14911 fn deser(
14912 _version: MavlinkVersion,
14913 __input: &[u8],
14914 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14915 let avail_len = __input.len();
14916 let mut payload_buf = [0; Self::ENCODED_LEN];
14917 let mut buf = if avail_len < Self::ENCODED_LEN {
14918 payload_buf[0..avail_len].copy_from_slice(__input);
14919 Bytes::new(&payload_buf)
14920 } else {
14921 Bytes::new(__input)
14922 };
14923 let mut __struct = Self::default();
14924 __struct.custom_mode = buf.get_u32_le();
14925 let tmp = buf.get_u8();
14926 __struct.mavtype =
14927 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14928 enum_type: "MavType",
14929 value: tmp as u64,
14930 })?;
14931 let tmp = buf.get_u8();
14932 __struct.autopilot =
14933 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14934 enum_type: "MavAutopilot",
14935 value: tmp as u64,
14936 })?;
14937 let tmp = buf.get_u8();
14938 __struct.base_mode =
14939 MavModeFlag::from_bits(tmp).ok_or(::mavlink_core::error::ParserError::InvalidFlag {
14940 flag_type: "MavModeFlag",
14941 value: tmp as u64,
14942 })?;
14943 let tmp = buf.get_u8();
14944 __struct.system_status =
14945 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14946 enum_type: "MavState",
14947 value: tmp as u64,
14948 })?;
14949 __struct.mavlink_version = buf.get_u8();
14950 Ok(__struct)
14951 }
14952 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14953 let mut __tmp = BytesMut::new(bytes);
14954 #[allow(clippy::absurd_extreme_comparisons)]
14955 #[allow(unused_comparisons)]
14956 if __tmp.remaining() < Self::ENCODED_LEN {
14957 panic!(
14958 "buffer is too small (need {} bytes, but got {})",
14959 Self::ENCODED_LEN,
14960 __tmp.remaining(),
14961 )
14962 }
14963 __tmp.put_u32_le(self.custom_mode);
14964 __tmp.put_u8(self.mavtype as u8);
14965 __tmp.put_u8(self.autopilot as u8);
14966 __tmp.put_u8(self.base_mode.bits());
14967 __tmp.put_u8(self.system_status as u8);
14968 __tmp.put_u8(self.mavlink_version);
14969 if matches!(version, MavlinkVersion::V2) {
14970 let len = __tmp.len();
14971 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14972 } else {
14973 __tmp.len()
14974 }
14975 }
14976}
14977#[doc = "The IMU readings in SI units in NED body frame."]
14978#[doc = ""]
14979#[doc = "ID: 105"]
14980#[derive(Debug, Clone, PartialEq)]
14981#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14982#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14983#[cfg_attr(feature = "ts", derive(TS))]
14984#[cfg_attr(feature = "ts", ts(export))]
14985pub struct HIGHRES_IMU_DATA {
14986 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14987 pub time_usec: u64,
14988 #[doc = "X acceleration"]
14989 pub xacc: f32,
14990 #[doc = "Y acceleration"]
14991 pub yacc: f32,
14992 #[doc = "Z acceleration"]
14993 pub zacc: f32,
14994 #[doc = "Angular speed around X axis"]
14995 pub xgyro: f32,
14996 #[doc = "Angular speed around Y axis"]
14997 pub ygyro: f32,
14998 #[doc = "Angular speed around Z axis"]
14999 pub zgyro: f32,
15000 #[doc = "X Magnetic field"]
15001 pub xmag: f32,
15002 #[doc = "Y Magnetic field"]
15003 pub ymag: f32,
15004 #[doc = "Z Magnetic field"]
15005 pub zmag: f32,
15006 #[doc = "Absolute pressure"]
15007 pub abs_pressure: f32,
15008 #[doc = "Differential pressure"]
15009 pub diff_pressure: f32,
15010 #[doc = "Altitude calculated from pressure"]
15011 pub pressure_alt: f32,
15012 #[doc = "Temperature"]
15013 pub temperature: f32,
15014 #[doc = "Bitmap for fields that have updated since last message"]
15015 pub fields_updated: HighresImuUpdatedFlags,
15016 #[doc = "Id. Ids are numbered from 0 and map to IMUs numbered from 1 (e.g. IMU1 will have a message with id=0)"]
15017 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15018 pub id: u8,
15019}
15020impl HIGHRES_IMU_DATA {
15021 pub const ENCODED_LEN: usize = 63usize;
15022 pub const DEFAULT: Self = Self {
15023 time_usec: 0_u64,
15024 xacc: 0.0_f32,
15025 yacc: 0.0_f32,
15026 zacc: 0.0_f32,
15027 xgyro: 0.0_f32,
15028 ygyro: 0.0_f32,
15029 zgyro: 0.0_f32,
15030 xmag: 0.0_f32,
15031 ymag: 0.0_f32,
15032 zmag: 0.0_f32,
15033 abs_pressure: 0.0_f32,
15034 diff_pressure: 0.0_f32,
15035 pressure_alt: 0.0_f32,
15036 temperature: 0.0_f32,
15037 fields_updated: HighresImuUpdatedFlags::DEFAULT,
15038 id: 0_u8,
15039 };
15040 #[cfg(feature = "arbitrary")]
15041 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15042 use arbitrary::{Arbitrary, Unstructured};
15043 let mut buf = [0u8; 1024];
15044 rng.fill_bytes(&mut buf);
15045 let mut unstructured = Unstructured::new(&buf);
15046 Self::arbitrary(&mut unstructured).unwrap_or_default()
15047 }
15048}
15049impl Default for HIGHRES_IMU_DATA {
15050 fn default() -> Self {
15051 Self::DEFAULT.clone()
15052 }
15053}
15054impl MessageData for HIGHRES_IMU_DATA {
15055 type Message = MavMessage;
15056 const ID: u32 = 105u32;
15057 const NAME: &'static str = "HIGHRES_IMU";
15058 const EXTRA_CRC: u8 = 93u8;
15059 const ENCODED_LEN: usize = 63usize;
15060 fn deser(
15061 _version: MavlinkVersion,
15062 __input: &[u8],
15063 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15064 let avail_len = __input.len();
15065 let mut payload_buf = [0; Self::ENCODED_LEN];
15066 let mut buf = if avail_len < Self::ENCODED_LEN {
15067 payload_buf[0..avail_len].copy_from_slice(__input);
15068 Bytes::new(&payload_buf)
15069 } else {
15070 Bytes::new(__input)
15071 };
15072 let mut __struct = Self::default();
15073 __struct.time_usec = buf.get_u64_le();
15074 __struct.xacc = buf.get_f32_le();
15075 __struct.yacc = buf.get_f32_le();
15076 __struct.zacc = buf.get_f32_le();
15077 __struct.xgyro = buf.get_f32_le();
15078 __struct.ygyro = buf.get_f32_le();
15079 __struct.zgyro = buf.get_f32_le();
15080 __struct.xmag = buf.get_f32_le();
15081 __struct.ymag = buf.get_f32_le();
15082 __struct.zmag = buf.get_f32_le();
15083 __struct.abs_pressure = buf.get_f32_le();
15084 __struct.diff_pressure = buf.get_f32_le();
15085 __struct.pressure_alt = buf.get_f32_le();
15086 __struct.temperature = buf.get_f32_le();
15087 let tmp = buf.get_u16_le();
15088 __struct.fields_updated = HighresImuUpdatedFlags::from_bits(tmp).ok_or(
15089 ::mavlink_core::error::ParserError::InvalidFlag {
15090 flag_type: "HighresImuUpdatedFlags",
15091 value: tmp as u64,
15092 },
15093 )?;
15094 __struct.id = buf.get_u8();
15095 Ok(__struct)
15096 }
15097 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15098 let mut __tmp = BytesMut::new(bytes);
15099 #[allow(clippy::absurd_extreme_comparisons)]
15100 #[allow(unused_comparisons)]
15101 if __tmp.remaining() < Self::ENCODED_LEN {
15102 panic!(
15103 "buffer is too small (need {} bytes, but got {})",
15104 Self::ENCODED_LEN,
15105 __tmp.remaining(),
15106 )
15107 }
15108 __tmp.put_u64_le(self.time_usec);
15109 __tmp.put_f32_le(self.xacc);
15110 __tmp.put_f32_le(self.yacc);
15111 __tmp.put_f32_le(self.zacc);
15112 __tmp.put_f32_le(self.xgyro);
15113 __tmp.put_f32_le(self.ygyro);
15114 __tmp.put_f32_le(self.zgyro);
15115 __tmp.put_f32_le(self.xmag);
15116 __tmp.put_f32_le(self.ymag);
15117 __tmp.put_f32_le(self.zmag);
15118 __tmp.put_f32_le(self.abs_pressure);
15119 __tmp.put_f32_le(self.diff_pressure);
15120 __tmp.put_f32_le(self.pressure_alt);
15121 __tmp.put_f32_le(self.temperature);
15122 __tmp.put_u16_le(self.fields_updated.bits());
15123 if matches!(version, MavlinkVersion::V2) {
15124 __tmp.put_u8(self.id);
15125 let len = __tmp.len();
15126 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15127 } else {
15128 __tmp.len()
15129 }
15130 }
15131}
15132#[deprecated = " See `HIGH_LATENCY2` (Deprecated since 2020-10)"]
15133#[doc = "Message appropriate for high latency connections like Iridium."]
15134#[doc = ""]
15135#[doc = "ID: 234"]
15136#[derive(Debug, Clone, PartialEq)]
15137#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15138#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15139#[cfg_attr(feature = "ts", derive(TS))]
15140#[cfg_attr(feature = "ts", ts(export))]
15141pub struct HIGH_LATENCY_DATA {
15142 #[doc = "A bitfield for use for autopilot-specific flags."]
15143 pub custom_mode: u32,
15144 #[doc = "Latitude"]
15145 pub latitude: i32,
15146 #[doc = "Longitude"]
15147 pub longitude: i32,
15148 #[doc = "roll"]
15149 pub roll: i16,
15150 #[doc = "pitch"]
15151 pub pitch: i16,
15152 #[doc = "heading"]
15153 pub heading: u16,
15154 #[doc = "heading setpoint"]
15155 pub heading_sp: i16,
15156 #[doc = "Altitude above mean sea level"]
15157 pub altitude_amsl: i16,
15158 #[doc = "Altitude setpoint relative to the home position"]
15159 pub altitude_sp: i16,
15160 #[doc = "distance to target"]
15161 pub wp_distance: u16,
15162 #[doc = "Bitmap of enabled system modes."]
15163 pub base_mode: MavModeFlag,
15164 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
15165 pub landed_state: MavLandedState,
15166 #[doc = "throttle (percentage)"]
15167 pub throttle: i8,
15168 #[doc = "airspeed"]
15169 pub airspeed: u8,
15170 #[doc = "airspeed setpoint"]
15171 pub airspeed_sp: u8,
15172 #[doc = "groundspeed"]
15173 pub groundspeed: u8,
15174 #[doc = "climb rate"]
15175 pub climb_rate: i8,
15176 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
15177 pub gps_nsat: u8,
15178 #[doc = "GPS Fix type."]
15179 pub gps_fix_type: GpsFixType,
15180 #[doc = "Remaining battery (percentage)"]
15181 pub battery_remaining: u8,
15182 #[doc = "Autopilot temperature (degrees C)"]
15183 pub temperature: i8,
15184 #[doc = "Air temperature (degrees C) from airspeed sensor"]
15185 pub temperature_air: i8,
15186 #[doc = "failsafe (each bit represents a failsafe where 0=ok, 1=failsafe active (bit0:RC, bit1:batt, bit2:GPS, bit3:GCS, bit4:fence)"]
15187 pub failsafe: u8,
15188 #[doc = "current waypoint number"]
15189 pub wp_num: u8,
15190}
15191impl HIGH_LATENCY_DATA {
15192 pub const ENCODED_LEN: usize = 40usize;
15193 pub const DEFAULT: Self = Self {
15194 custom_mode: 0_u32,
15195 latitude: 0_i32,
15196 longitude: 0_i32,
15197 roll: 0_i16,
15198 pitch: 0_i16,
15199 heading: 0_u16,
15200 heading_sp: 0_i16,
15201 altitude_amsl: 0_i16,
15202 altitude_sp: 0_i16,
15203 wp_distance: 0_u16,
15204 base_mode: MavModeFlag::DEFAULT,
15205 landed_state: MavLandedState::DEFAULT,
15206 throttle: 0_i8,
15207 airspeed: 0_u8,
15208 airspeed_sp: 0_u8,
15209 groundspeed: 0_u8,
15210 climb_rate: 0_i8,
15211 gps_nsat: 0_u8,
15212 gps_fix_type: GpsFixType::DEFAULT,
15213 battery_remaining: 0_u8,
15214 temperature: 0_i8,
15215 temperature_air: 0_i8,
15216 failsafe: 0_u8,
15217 wp_num: 0_u8,
15218 };
15219 #[cfg(feature = "arbitrary")]
15220 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15221 use arbitrary::{Arbitrary, Unstructured};
15222 let mut buf = [0u8; 1024];
15223 rng.fill_bytes(&mut buf);
15224 let mut unstructured = Unstructured::new(&buf);
15225 Self::arbitrary(&mut unstructured).unwrap_or_default()
15226 }
15227}
15228impl Default for HIGH_LATENCY_DATA {
15229 fn default() -> Self {
15230 Self::DEFAULT.clone()
15231 }
15232}
15233impl MessageData for HIGH_LATENCY_DATA {
15234 type Message = MavMessage;
15235 const ID: u32 = 234u32;
15236 const NAME: &'static str = "HIGH_LATENCY";
15237 const EXTRA_CRC: u8 = 150u8;
15238 const ENCODED_LEN: usize = 40usize;
15239 fn deser(
15240 _version: MavlinkVersion,
15241 __input: &[u8],
15242 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15243 let avail_len = __input.len();
15244 let mut payload_buf = [0; Self::ENCODED_LEN];
15245 let mut buf = if avail_len < Self::ENCODED_LEN {
15246 payload_buf[0..avail_len].copy_from_slice(__input);
15247 Bytes::new(&payload_buf)
15248 } else {
15249 Bytes::new(__input)
15250 };
15251 let mut __struct = Self::default();
15252 __struct.custom_mode = buf.get_u32_le();
15253 __struct.latitude = buf.get_i32_le();
15254 __struct.longitude = buf.get_i32_le();
15255 __struct.roll = buf.get_i16_le();
15256 __struct.pitch = buf.get_i16_le();
15257 __struct.heading = buf.get_u16_le();
15258 __struct.heading_sp = buf.get_i16_le();
15259 __struct.altitude_amsl = buf.get_i16_le();
15260 __struct.altitude_sp = buf.get_i16_le();
15261 __struct.wp_distance = buf.get_u16_le();
15262 let tmp = buf.get_u8();
15263 __struct.base_mode =
15264 MavModeFlag::from_bits(tmp).ok_or(::mavlink_core::error::ParserError::InvalidFlag {
15265 flag_type: "MavModeFlag",
15266 value: tmp as u64,
15267 })?;
15268 let tmp = buf.get_u8();
15269 __struct.landed_state =
15270 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15271 enum_type: "MavLandedState",
15272 value: tmp as u64,
15273 })?;
15274 __struct.throttle = buf.get_i8();
15275 __struct.airspeed = buf.get_u8();
15276 __struct.airspeed_sp = buf.get_u8();
15277 __struct.groundspeed = buf.get_u8();
15278 __struct.climb_rate = buf.get_i8();
15279 __struct.gps_nsat = buf.get_u8();
15280 let tmp = buf.get_u8();
15281 __struct.gps_fix_type =
15282 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15283 enum_type: "GpsFixType",
15284 value: tmp as u64,
15285 })?;
15286 __struct.battery_remaining = buf.get_u8();
15287 __struct.temperature = buf.get_i8();
15288 __struct.temperature_air = buf.get_i8();
15289 __struct.failsafe = buf.get_u8();
15290 __struct.wp_num = buf.get_u8();
15291 Ok(__struct)
15292 }
15293 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15294 let mut __tmp = BytesMut::new(bytes);
15295 #[allow(clippy::absurd_extreme_comparisons)]
15296 #[allow(unused_comparisons)]
15297 if __tmp.remaining() < Self::ENCODED_LEN {
15298 panic!(
15299 "buffer is too small (need {} bytes, but got {})",
15300 Self::ENCODED_LEN,
15301 __tmp.remaining(),
15302 )
15303 }
15304 __tmp.put_u32_le(self.custom_mode);
15305 __tmp.put_i32_le(self.latitude);
15306 __tmp.put_i32_le(self.longitude);
15307 __tmp.put_i16_le(self.roll);
15308 __tmp.put_i16_le(self.pitch);
15309 __tmp.put_u16_le(self.heading);
15310 __tmp.put_i16_le(self.heading_sp);
15311 __tmp.put_i16_le(self.altitude_amsl);
15312 __tmp.put_i16_le(self.altitude_sp);
15313 __tmp.put_u16_le(self.wp_distance);
15314 __tmp.put_u8(self.base_mode.bits());
15315 __tmp.put_u8(self.landed_state as u8);
15316 __tmp.put_i8(self.throttle);
15317 __tmp.put_u8(self.airspeed);
15318 __tmp.put_u8(self.airspeed_sp);
15319 __tmp.put_u8(self.groundspeed);
15320 __tmp.put_i8(self.climb_rate);
15321 __tmp.put_u8(self.gps_nsat);
15322 __tmp.put_u8(self.gps_fix_type as u8);
15323 __tmp.put_u8(self.battery_remaining);
15324 __tmp.put_i8(self.temperature);
15325 __tmp.put_i8(self.temperature_air);
15326 __tmp.put_u8(self.failsafe);
15327 __tmp.put_u8(self.wp_num);
15328 if matches!(version, MavlinkVersion::V2) {
15329 let len = __tmp.len();
15330 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15331 } else {
15332 __tmp.len()
15333 }
15334 }
15335}
15336#[doc = "Message appropriate for high latency connections like Iridium (version 2)."]
15337#[doc = ""]
15338#[doc = "ID: 235"]
15339#[derive(Debug, Clone, PartialEq)]
15340#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15341#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15342#[cfg_attr(feature = "ts", derive(TS))]
15343#[cfg_attr(feature = "ts", ts(export))]
15344pub struct HIGH_LATENCY2_DATA {
15345 #[doc = "Timestamp (milliseconds since boot or Unix epoch)"]
15346 pub timestamp: u32,
15347 #[doc = "Latitude"]
15348 pub latitude: i32,
15349 #[doc = "Longitude"]
15350 pub longitude: i32,
15351 #[doc = "A bitfield for use for autopilot-specific flags (2 byte version)."]
15352 pub custom_mode: u16,
15353 #[doc = "Altitude above mean sea level"]
15354 pub altitude: i16,
15355 #[doc = "Altitude setpoint"]
15356 pub target_altitude: i16,
15357 #[doc = "Distance to target waypoint or position"]
15358 pub target_distance: u16,
15359 #[doc = "Current waypoint number"]
15360 pub wp_num: u16,
15361 #[doc = "Bitmap of failure flags."]
15362 pub failure_flags: HlFailureFlag,
15363 #[doc = "Type of the MAV (quadrotor, helicopter, etc.)"]
15364 pub mavtype: MavType,
15365 #[doc = "Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers."]
15366 pub autopilot: MavAutopilot,
15367 #[doc = "Heading"]
15368 pub heading: u8,
15369 #[doc = "Heading setpoint"]
15370 pub target_heading: u8,
15371 #[doc = "Throttle"]
15372 pub throttle: u8,
15373 #[doc = "Airspeed"]
15374 pub airspeed: u8,
15375 #[doc = "Airspeed setpoint"]
15376 pub airspeed_sp: u8,
15377 #[doc = "Groundspeed"]
15378 pub groundspeed: u8,
15379 #[doc = "Windspeed"]
15380 pub windspeed: u8,
15381 #[doc = "Wind heading"]
15382 pub wind_heading: u8,
15383 #[doc = "Maximum error horizontal position since last message"]
15384 pub eph: u8,
15385 #[doc = "Maximum error vertical position since last message"]
15386 pub epv: u8,
15387 #[doc = "Air temperature"]
15388 pub temperature_air: i8,
15389 #[doc = "Maximum climb rate magnitude since last message"]
15390 pub climb_rate: i8,
15391 #[doc = "Battery level (-1 if field not provided)."]
15392 pub battery: i8,
15393 #[doc = "Field for custom payload."]
15394 pub custom0: i8,
15395 #[doc = "Field for custom payload."]
15396 pub custom1: i8,
15397 #[doc = "Field for custom payload."]
15398 pub custom2: i8,
15399}
15400impl HIGH_LATENCY2_DATA {
15401 pub const ENCODED_LEN: usize = 42usize;
15402 pub const DEFAULT: Self = Self {
15403 timestamp: 0_u32,
15404 latitude: 0_i32,
15405 longitude: 0_i32,
15406 custom_mode: 0_u16,
15407 altitude: 0_i16,
15408 target_altitude: 0_i16,
15409 target_distance: 0_u16,
15410 wp_num: 0_u16,
15411 failure_flags: HlFailureFlag::DEFAULT,
15412 mavtype: MavType::DEFAULT,
15413 autopilot: MavAutopilot::DEFAULT,
15414 heading: 0_u8,
15415 target_heading: 0_u8,
15416 throttle: 0_u8,
15417 airspeed: 0_u8,
15418 airspeed_sp: 0_u8,
15419 groundspeed: 0_u8,
15420 windspeed: 0_u8,
15421 wind_heading: 0_u8,
15422 eph: 0_u8,
15423 epv: 0_u8,
15424 temperature_air: 0_i8,
15425 climb_rate: 0_i8,
15426 battery: 0_i8,
15427 custom0: 0_i8,
15428 custom1: 0_i8,
15429 custom2: 0_i8,
15430 };
15431 #[cfg(feature = "arbitrary")]
15432 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15433 use arbitrary::{Arbitrary, Unstructured};
15434 let mut buf = [0u8; 1024];
15435 rng.fill_bytes(&mut buf);
15436 let mut unstructured = Unstructured::new(&buf);
15437 Self::arbitrary(&mut unstructured).unwrap_or_default()
15438 }
15439}
15440impl Default for HIGH_LATENCY2_DATA {
15441 fn default() -> Self {
15442 Self::DEFAULT.clone()
15443 }
15444}
15445impl MessageData for HIGH_LATENCY2_DATA {
15446 type Message = MavMessage;
15447 const ID: u32 = 235u32;
15448 const NAME: &'static str = "HIGH_LATENCY2";
15449 const EXTRA_CRC: u8 = 179u8;
15450 const ENCODED_LEN: usize = 42usize;
15451 fn deser(
15452 _version: MavlinkVersion,
15453 __input: &[u8],
15454 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15455 let avail_len = __input.len();
15456 let mut payload_buf = [0; Self::ENCODED_LEN];
15457 let mut buf = if avail_len < Self::ENCODED_LEN {
15458 payload_buf[0..avail_len].copy_from_slice(__input);
15459 Bytes::new(&payload_buf)
15460 } else {
15461 Bytes::new(__input)
15462 };
15463 let mut __struct = Self::default();
15464 __struct.timestamp = buf.get_u32_le();
15465 __struct.latitude = buf.get_i32_le();
15466 __struct.longitude = buf.get_i32_le();
15467 __struct.custom_mode = buf.get_u16_le();
15468 __struct.altitude = buf.get_i16_le();
15469 __struct.target_altitude = buf.get_i16_le();
15470 __struct.target_distance = buf.get_u16_le();
15471 __struct.wp_num = buf.get_u16_le();
15472 let tmp = buf.get_u16_le();
15473 __struct.failure_flags = HlFailureFlag::from_bits(tmp).ok_or(
15474 ::mavlink_core::error::ParserError::InvalidFlag {
15475 flag_type: "HlFailureFlag",
15476 value: tmp as u64,
15477 },
15478 )?;
15479 let tmp = buf.get_u8();
15480 __struct.mavtype =
15481 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15482 enum_type: "MavType",
15483 value: tmp as u64,
15484 })?;
15485 let tmp = buf.get_u8();
15486 __struct.autopilot =
15487 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15488 enum_type: "MavAutopilot",
15489 value: tmp as u64,
15490 })?;
15491 __struct.heading = buf.get_u8();
15492 __struct.target_heading = buf.get_u8();
15493 __struct.throttle = buf.get_u8();
15494 __struct.airspeed = buf.get_u8();
15495 __struct.airspeed_sp = buf.get_u8();
15496 __struct.groundspeed = buf.get_u8();
15497 __struct.windspeed = buf.get_u8();
15498 __struct.wind_heading = buf.get_u8();
15499 __struct.eph = buf.get_u8();
15500 __struct.epv = buf.get_u8();
15501 __struct.temperature_air = buf.get_i8();
15502 __struct.climb_rate = buf.get_i8();
15503 __struct.battery = buf.get_i8();
15504 __struct.custom0 = buf.get_i8();
15505 __struct.custom1 = buf.get_i8();
15506 __struct.custom2 = buf.get_i8();
15507 Ok(__struct)
15508 }
15509 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15510 let mut __tmp = BytesMut::new(bytes);
15511 #[allow(clippy::absurd_extreme_comparisons)]
15512 #[allow(unused_comparisons)]
15513 if __tmp.remaining() < Self::ENCODED_LEN {
15514 panic!(
15515 "buffer is too small (need {} bytes, but got {})",
15516 Self::ENCODED_LEN,
15517 __tmp.remaining(),
15518 )
15519 }
15520 __tmp.put_u32_le(self.timestamp);
15521 __tmp.put_i32_le(self.latitude);
15522 __tmp.put_i32_le(self.longitude);
15523 __tmp.put_u16_le(self.custom_mode);
15524 __tmp.put_i16_le(self.altitude);
15525 __tmp.put_i16_le(self.target_altitude);
15526 __tmp.put_u16_le(self.target_distance);
15527 __tmp.put_u16_le(self.wp_num);
15528 __tmp.put_u16_le(self.failure_flags.bits());
15529 __tmp.put_u8(self.mavtype as u8);
15530 __tmp.put_u8(self.autopilot as u8);
15531 __tmp.put_u8(self.heading);
15532 __tmp.put_u8(self.target_heading);
15533 __tmp.put_u8(self.throttle);
15534 __tmp.put_u8(self.airspeed);
15535 __tmp.put_u8(self.airspeed_sp);
15536 __tmp.put_u8(self.groundspeed);
15537 __tmp.put_u8(self.windspeed);
15538 __tmp.put_u8(self.wind_heading);
15539 __tmp.put_u8(self.eph);
15540 __tmp.put_u8(self.epv);
15541 __tmp.put_i8(self.temperature_air);
15542 __tmp.put_i8(self.climb_rate);
15543 __tmp.put_i8(self.battery);
15544 __tmp.put_i8(self.custom0);
15545 __tmp.put_i8(self.custom1);
15546 __tmp.put_i8(self.custom2);
15547 if matches!(version, MavlinkVersion::V2) {
15548 let len = __tmp.len();
15549 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15550 } else {
15551 __tmp.len()
15552 }
15553 }
15554}
15555#[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_CONTROLS."]
15556#[doc = ""]
15557#[doc = "ID: 93"]
15558#[derive(Debug, Clone, PartialEq)]
15559#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15560#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15561#[cfg_attr(feature = "ts", derive(TS))]
15562#[cfg_attr(feature = "ts", ts(export))]
15563pub struct HIL_ACTUATOR_CONTROLS_DATA {
15564 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15565 pub time_usec: u64,
15566 #[doc = "Flags bitmask."]
15567 pub flags: HilActuatorControlsFlags,
15568 #[doc = "Control outputs -1 .. 1. Channel assignment depends on the simulated hardware."]
15569 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15570 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
15571 pub controls: [f32; 16],
15572 #[doc = "System mode. Includes arming state."]
15573 pub mode: MavModeFlag,
15574}
15575impl HIL_ACTUATOR_CONTROLS_DATA {
15576 pub const ENCODED_LEN: usize = 81usize;
15577 pub const DEFAULT: Self = Self {
15578 time_usec: 0_u64,
15579 flags: HilActuatorControlsFlags::DEFAULT,
15580 controls: [0.0_f32; 16usize],
15581 mode: MavModeFlag::DEFAULT,
15582 };
15583 #[cfg(feature = "arbitrary")]
15584 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15585 use arbitrary::{Arbitrary, Unstructured};
15586 let mut buf = [0u8; 1024];
15587 rng.fill_bytes(&mut buf);
15588 let mut unstructured = Unstructured::new(&buf);
15589 Self::arbitrary(&mut unstructured).unwrap_or_default()
15590 }
15591}
15592impl Default for HIL_ACTUATOR_CONTROLS_DATA {
15593 fn default() -> Self {
15594 Self::DEFAULT.clone()
15595 }
15596}
15597impl MessageData for HIL_ACTUATOR_CONTROLS_DATA {
15598 type Message = MavMessage;
15599 const ID: u32 = 93u32;
15600 const NAME: &'static str = "HIL_ACTUATOR_CONTROLS";
15601 const EXTRA_CRC: u8 = 47u8;
15602 const ENCODED_LEN: usize = 81usize;
15603 fn deser(
15604 _version: MavlinkVersion,
15605 __input: &[u8],
15606 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15607 let avail_len = __input.len();
15608 let mut payload_buf = [0; Self::ENCODED_LEN];
15609 let mut buf = if avail_len < Self::ENCODED_LEN {
15610 payload_buf[0..avail_len].copy_from_slice(__input);
15611 Bytes::new(&payload_buf)
15612 } else {
15613 Bytes::new(__input)
15614 };
15615 let mut __struct = Self::default();
15616 __struct.time_usec = buf.get_u64_le();
15617 let tmp = buf.get_u64_le();
15618 __struct.flags = HilActuatorControlsFlags::from_bits(tmp).ok_or(
15619 ::mavlink_core::error::ParserError::InvalidFlag {
15620 flag_type: "HilActuatorControlsFlags",
15621 value: tmp as u64,
15622 },
15623 )?;
15624 for v in &mut __struct.controls {
15625 let val = buf.get_f32_le();
15626 *v = val;
15627 }
15628 let tmp = buf.get_u8();
15629 __struct.mode =
15630 MavModeFlag::from_bits(tmp).ok_or(::mavlink_core::error::ParserError::InvalidFlag {
15631 flag_type: "MavModeFlag",
15632 value: tmp as u64,
15633 })?;
15634 Ok(__struct)
15635 }
15636 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15637 let mut __tmp = BytesMut::new(bytes);
15638 #[allow(clippy::absurd_extreme_comparisons)]
15639 #[allow(unused_comparisons)]
15640 if __tmp.remaining() < Self::ENCODED_LEN {
15641 panic!(
15642 "buffer is too small (need {} bytes, but got {})",
15643 Self::ENCODED_LEN,
15644 __tmp.remaining(),
15645 )
15646 }
15647 __tmp.put_u64_le(self.time_usec);
15648 __tmp.put_u64_le(self.flags.bits());
15649 for val in &self.controls {
15650 __tmp.put_f32_le(*val);
15651 }
15652 __tmp.put_u8(self.mode.bits());
15653 if matches!(version, MavlinkVersion::V2) {
15654 let len = __tmp.len();
15655 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15656 } else {
15657 __tmp.len()
15658 }
15659 }
15660}
15661#[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_ACTUATOR_CONTROLS."]
15662#[doc = ""]
15663#[doc = "ID: 91"]
15664#[derive(Debug, Clone, PartialEq)]
15665#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15666#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15667#[cfg_attr(feature = "ts", derive(TS))]
15668#[cfg_attr(feature = "ts", ts(export))]
15669pub struct HIL_CONTROLS_DATA {
15670 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15671 pub time_usec: u64,
15672 #[doc = "Control output -1 .. 1"]
15673 pub roll_ailerons: f32,
15674 #[doc = "Control output -1 .. 1"]
15675 pub pitch_elevator: f32,
15676 #[doc = "Control output -1 .. 1"]
15677 pub yaw_rudder: f32,
15678 #[doc = "Throttle 0 .. 1"]
15679 pub throttle: f32,
15680 #[doc = "Aux 1, -1 .. 1"]
15681 pub aux1: f32,
15682 #[doc = "Aux 2, -1 .. 1"]
15683 pub aux2: f32,
15684 #[doc = "Aux 3, -1 .. 1"]
15685 pub aux3: f32,
15686 #[doc = "Aux 4, -1 .. 1"]
15687 pub aux4: f32,
15688 #[doc = "System mode."]
15689 pub mode: MavMode,
15690 #[doc = "Navigation mode (MAV_NAV_MODE)"]
15691 pub nav_mode: u8,
15692}
15693impl HIL_CONTROLS_DATA {
15694 pub const ENCODED_LEN: usize = 42usize;
15695 pub const DEFAULT: Self = Self {
15696 time_usec: 0_u64,
15697 roll_ailerons: 0.0_f32,
15698 pitch_elevator: 0.0_f32,
15699 yaw_rudder: 0.0_f32,
15700 throttle: 0.0_f32,
15701 aux1: 0.0_f32,
15702 aux2: 0.0_f32,
15703 aux3: 0.0_f32,
15704 aux4: 0.0_f32,
15705 mode: MavMode::DEFAULT,
15706 nav_mode: 0_u8,
15707 };
15708 #[cfg(feature = "arbitrary")]
15709 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15710 use arbitrary::{Arbitrary, Unstructured};
15711 let mut buf = [0u8; 1024];
15712 rng.fill_bytes(&mut buf);
15713 let mut unstructured = Unstructured::new(&buf);
15714 Self::arbitrary(&mut unstructured).unwrap_or_default()
15715 }
15716}
15717impl Default for HIL_CONTROLS_DATA {
15718 fn default() -> Self {
15719 Self::DEFAULT.clone()
15720 }
15721}
15722impl MessageData for HIL_CONTROLS_DATA {
15723 type Message = MavMessage;
15724 const ID: u32 = 91u32;
15725 const NAME: &'static str = "HIL_CONTROLS";
15726 const EXTRA_CRC: u8 = 63u8;
15727 const ENCODED_LEN: usize = 42usize;
15728 fn deser(
15729 _version: MavlinkVersion,
15730 __input: &[u8],
15731 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15732 let avail_len = __input.len();
15733 let mut payload_buf = [0; Self::ENCODED_LEN];
15734 let mut buf = if avail_len < Self::ENCODED_LEN {
15735 payload_buf[0..avail_len].copy_from_slice(__input);
15736 Bytes::new(&payload_buf)
15737 } else {
15738 Bytes::new(__input)
15739 };
15740 let mut __struct = Self::default();
15741 __struct.time_usec = buf.get_u64_le();
15742 __struct.roll_ailerons = buf.get_f32_le();
15743 __struct.pitch_elevator = buf.get_f32_le();
15744 __struct.yaw_rudder = buf.get_f32_le();
15745 __struct.throttle = buf.get_f32_le();
15746 __struct.aux1 = buf.get_f32_le();
15747 __struct.aux2 = buf.get_f32_le();
15748 __struct.aux3 = buf.get_f32_le();
15749 __struct.aux4 = buf.get_f32_le();
15750 let tmp = buf.get_u8();
15751 __struct.mode =
15752 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15753 enum_type: "MavMode",
15754 value: tmp as u64,
15755 })?;
15756 __struct.nav_mode = buf.get_u8();
15757 Ok(__struct)
15758 }
15759 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15760 let mut __tmp = BytesMut::new(bytes);
15761 #[allow(clippy::absurd_extreme_comparisons)]
15762 #[allow(unused_comparisons)]
15763 if __tmp.remaining() < Self::ENCODED_LEN {
15764 panic!(
15765 "buffer is too small (need {} bytes, but got {})",
15766 Self::ENCODED_LEN,
15767 __tmp.remaining(),
15768 )
15769 }
15770 __tmp.put_u64_le(self.time_usec);
15771 __tmp.put_f32_le(self.roll_ailerons);
15772 __tmp.put_f32_le(self.pitch_elevator);
15773 __tmp.put_f32_le(self.yaw_rudder);
15774 __tmp.put_f32_le(self.throttle);
15775 __tmp.put_f32_le(self.aux1);
15776 __tmp.put_f32_le(self.aux2);
15777 __tmp.put_f32_le(self.aux3);
15778 __tmp.put_f32_le(self.aux4);
15779 __tmp.put_u8(self.mode as u8);
15780 __tmp.put_u8(self.nav_mode);
15781 if matches!(version, MavlinkVersion::V2) {
15782 let len = __tmp.len();
15783 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15784 } else {
15785 __tmp.len()
15786 }
15787 }
15788}
15789#[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
15790#[doc = ""]
15791#[doc = "ID: 113"]
15792#[derive(Debug, Clone, PartialEq)]
15793#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15794#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15795#[cfg_attr(feature = "ts", derive(TS))]
15796#[cfg_attr(feature = "ts", ts(export))]
15797pub struct HIL_GPS_DATA {
15798 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15799 pub time_usec: u64,
15800 #[doc = "Latitude (WGS84)"]
15801 pub lat: i32,
15802 #[doc = "Longitude (WGS84)"]
15803 pub lon: i32,
15804 #[doc = "Altitude (MSL). Positive for up."]
15805 pub alt: i32,
15806 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
15807 pub eph: u16,
15808 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
15809 pub epv: u16,
15810 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
15811 pub vel: u16,
15812 #[doc = "GPS velocity in north direction in earth-fixed NED frame"]
15813 pub vn: i16,
15814 #[doc = "GPS velocity in east direction in earth-fixed NED frame"]
15815 pub ve: i16,
15816 #[doc = "GPS velocity in down direction in earth-fixed NED frame"]
15817 pub vd: i16,
15818 #[doc = "Course over ground (NOT heading, but direction of movement), 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
15819 pub cog: u16,
15820 #[doc = "0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix."]
15821 pub fix_type: u8,
15822 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
15823 pub satellites_visible: u8,
15824 #[doc = "GPS ID (zero indexed). Used for multiple GPS inputs"]
15825 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15826 pub id: u8,
15827 #[doc = "Yaw of vehicle relative to Earth's North, zero means not available, use 36000 for north"]
15828 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15829 pub yaw: u16,
15830}
15831impl HIL_GPS_DATA {
15832 pub const ENCODED_LEN: usize = 39usize;
15833 pub const DEFAULT: Self = Self {
15834 time_usec: 0_u64,
15835 lat: 0_i32,
15836 lon: 0_i32,
15837 alt: 0_i32,
15838 eph: 0_u16,
15839 epv: 0_u16,
15840 vel: 0_u16,
15841 vn: 0_i16,
15842 ve: 0_i16,
15843 vd: 0_i16,
15844 cog: 0_u16,
15845 fix_type: 0_u8,
15846 satellites_visible: 0_u8,
15847 id: 0_u8,
15848 yaw: 0_u16,
15849 };
15850 #[cfg(feature = "arbitrary")]
15851 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15852 use arbitrary::{Arbitrary, Unstructured};
15853 let mut buf = [0u8; 1024];
15854 rng.fill_bytes(&mut buf);
15855 let mut unstructured = Unstructured::new(&buf);
15856 Self::arbitrary(&mut unstructured).unwrap_or_default()
15857 }
15858}
15859impl Default for HIL_GPS_DATA {
15860 fn default() -> Self {
15861 Self::DEFAULT.clone()
15862 }
15863}
15864impl MessageData for HIL_GPS_DATA {
15865 type Message = MavMessage;
15866 const ID: u32 = 113u32;
15867 const NAME: &'static str = "HIL_GPS";
15868 const EXTRA_CRC: u8 = 124u8;
15869 const ENCODED_LEN: usize = 39usize;
15870 fn deser(
15871 _version: MavlinkVersion,
15872 __input: &[u8],
15873 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15874 let avail_len = __input.len();
15875 let mut payload_buf = [0; Self::ENCODED_LEN];
15876 let mut buf = if avail_len < Self::ENCODED_LEN {
15877 payload_buf[0..avail_len].copy_from_slice(__input);
15878 Bytes::new(&payload_buf)
15879 } else {
15880 Bytes::new(__input)
15881 };
15882 let mut __struct = Self::default();
15883 __struct.time_usec = buf.get_u64_le();
15884 __struct.lat = buf.get_i32_le();
15885 __struct.lon = buf.get_i32_le();
15886 __struct.alt = buf.get_i32_le();
15887 __struct.eph = buf.get_u16_le();
15888 __struct.epv = buf.get_u16_le();
15889 __struct.vel = buf.get_u16_le();
15890 __struct.vn = buf.get_i16_le();
15891 __struct.ve = buf.get_i16_le();
15892 __struct.vd = buf.get_i16_le();
15893 __struct.cog = buf.get_u16_le();
15894 __struct.fix_type = buf.get_u8();
15895 __struct.satellites_visible = buf.get_u8();
15896 __struct.id = buf.get_u8();
15897 __struct.yaw = buf.get_u16_le();
15898 Ok(__struct)
15899 }
15900 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15901 let mut __tmp = BytesMut::new(bytes);
15902 #[allow(clippy::absurd_extreme_comparisons)]
15903 #[allow(unused_comparisons)]
15904 if __tmp.remaining() < Self::ENCODED_LEN {
15905 panic!(
15906 "buffer is too small (need {} bytes, but got {})",
15907 Self::ENCODED_LEN,
15908 __tmp.remaining(),
15909 )
15910 }
15911 __tmp.put_u64_le(self.time_usec);
15912 __tmp.put_i32_le(self.lat);
15913 __tmp.put_i32_le(self.lon);
15914 __tmp.put_i32_le(self.alt);
15915 __tmp.put_u16_le(self.eph);
15916 __tmp.put_u16_le(self.epv);
15917 __tmp.put_u16_le(self.vel);
15918 __tmp.put_i16_le(self.vn);
15919 __tmp.put_i16_le(self.ve);
15920 __tmp.put_i16_le(self.vd);
15921 __tmp.put_u16_le(self.cog);
15922 __tmp.put_u8(self.fix_type);
15923 __tmp.put_u8(self.satellites_visible);
15924 if matches!(version, MavlinkVersion::V2) {
15925 __tmp.put_u8(self.id);
15926 __tmp.put_u16_le(self.yaw);
15927 let len = __tmp.len();
15928 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15929 } else {
15930 __tmp.len()
15931 }
15932 }
15933}
15934#[doc = "Simulated optical flow from a flow sensor (e.g. PX4FLOW or optical mouse sensor)."]
15935#[doc = ""]
15936#[doc = "ID: 114"]
15937#[derive(Debug, Clone, PartialEq)]
15938#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15939#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15940#[cfg_attr(feature = "ts", derive(TS))]
15941#[cfg_attr(feature = "ts", ts(export))]
15942pub struct HIL_OPTICAL_FLOW_DATA {
15943 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15944 pub time_usec: u64,
15945 #[doc = "Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the."]
15946 pub integration_time_us: u32,
15947 #[doc = "Flow in radians around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)"]
15948 pub integrated_x: f32,
15949 #[doc = "Flow in radians around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)"]
15950 pub integrated_y: f32,
15951 #[doc = "RH rotation around X axis"]
15952 pub integrated_xgyro: f32,
15953 #[doc = "RH rotation around Y axis"]
15954 pub integrated_ygyro: f32,
15955 #[doc = "RH rotation around Z axis"]
15956 pub integrated_zgyro: f32,
15957 #[doc = "Time since the distance was sampled."]
15958 pub time_delta_distance_us: u32,
15959 #[doc = "Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance."]
15960 pub distance: f32,
15961 #[doc = "Temperature"]
15962 pub temperature: i16,
15963 #[doc = "Sensor ID"]
15964 pub sensor_id: u8,
15965 #[doc = "Optical flow quality / confidence. 0: no valid flow, 255: maximum quality"]
15966 pub quality: u8,
15967}
15968impl HIL_OPTICAL_FLOW_DATA {
15969 pub const ENCODED_LEN: usize = 44usize;
15970 pub const DEFAULT: Self = Self {
15971 time_usec: 0_u64,
15972 integration_time_us: 0_u32,
15973 integrated_x: 0.0_f32,
15974 integrated_y: 0.0_f32,
15975 integrated_xgyro: 0.0_f32,
15976 integrated_ygyro: 0.0_f32,
15977 integrated_zgyro: 0.0_f32,
15978 time_delta_distance_us: 0_u32,
15979 distance: 0.0_f32,
15980 temperature: 0_i16,
15981 sensor_id: 0_u8,
15982 quality: 0_u8,
15983 };
15984 #[cfg(feature = "arbitrary")]
15985 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15986 use arbitrary::{Arbitrary, Unstructured};
15987 let mut buf = [0u8; 1024];
15988 rng.fill_bytes(&mut buf);
15989 let mut unstructured = Unstructured::new(&buf);
15990 Self::arbitrary(&mut unstructured).unwrap_or_default()
15991 }
15992}
15993impl Default for HIL_OPTICAL_FLOW_DATA {
15994 fn default() -> Self {
15995 Self::DEFAULT.clone()
15996 }
15997}
15998impl MessageData for HIL_OPTICAL_FLOW_DATA {
15999 type Message = MavMessage;
16000 const ID: u32 = 114u32;
16001 const NAME: &'static str = "HIL_OPTICAL_FLOW";
16002 const EXTRA_CRC: u8 = 237u8;
16003 const ENCODED_LEN: usize = 44usize;
16004 fn deser(
16005 _version: MavlinkVersion,
16006 __input: &[u8],
16007 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16008 let avail_len = __input.len();
16009 let mut payload_buf = [0; Self::ENCODED_LEN];
16010 let mut buf = if avail_len < Self::ENCODED_LEN {
16011 payload_buf[0..avail_len].copy_from_slice(__input);
16012 Bytes::new(&payload_buf)
16013 } else {
16014 Bytes::new(__input)
16015 };
16016 let mut __struct = Self::default();
16017 __struct.time_usec = buf.get_u64_le();
16018 __struct.integration_time_us = buf.get_u32_le();
16019 __struct.integrated_x = buf.get_f32_le();
16020 __struct.integrated_y = buf.get_f32_le();
16021 __struct.integrated_xgyro = buf.get_f32_le();
16022 __struct.integrated_ygyro = buf.get_f32_le();
16023 __struct.integrated_zgyro = buf.get_f32_le();
16024 __struct.time_delta_distance_us = buf.get_u32_le();
16025 __struct.distance = buf.get_f32_le();
16026 __struct.temperature = buf.get_i16_le();
16027 __struct.sensor_id = buf.get_u8();
16028 __struct.quality = buf.get_u8();
16029 Ok(__struct)
16030 }
16031 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16032 let mut __tmp = BytesMut::new(bytes);
16033 #[allow(clippy::absurd_extreme_comparisons)]
16034 #[allow(unused_comparisons)]
16035 if __tmp.remaining() < Self::ENCODED_LEN {
16036 panic!(
16037 "buffer is too small (need {} bytes, but got {})",
16038 Self::ENCODED_LEN,
16039 __tmp.remaining(),
16040 )
16041 }
16042 __tmp.put_u64_le(self.time_usec);
16043 __tmp.put_u32_le(self.integration_time_us);
16044 __tmp.put_f32_le(self.integrated_x);
16045 __tmp.put_f32_le(self.integrated_y);
16046 __tmp.put_f32_le(self.integrated_xgyro);
16047 __tmp.put_f32_le(self.integrated_ygyro);
16048 __tmp.put_f32_le(self.integrated_zgyro);
16049 __tmp.put_u32_le(self.time_delta_distance_us);
16050 __tmp.put_f32_le(self.distance);
16051 __tmp.put_i16_le(self.temperature);
16052 __tmp.put_u8(self.sensor_id);
16053 __tmp.put_u8(self.quality);
16054 if matches!(version, MavlinkVersion::V2) {
16055 let len = __tmp.len();
16056 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16057 } else {
16058 __tmp.len()
16059 }
16060 }
16061}
16062#[doc = "Sent from simulation to autopilot. The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification."]
16063#[doc = ""]
16064#[doc = "ID: 92"]
16065#[derive(Debug, Clone, PartialEq)]
16066#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16067#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16068#[cfg_attr(feature = "ts", derive(TS))]
16069#[cfg_attr(feature = "ts", ts(export))]
16070pub struct HIL_RC_INPUTS_RAW_DATA {
16071 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16072 pub time_usec: u64,
16073 #[doc = "RC channel 1 value"]
16074 pub chan1_raw: u16,
16075 #[doc = "RC channel 2 value"]
16076 pub chan2_raw: u16,
16077 #[doc = "RC channel 3 value"]
16078 pub chan3_raw: u16,
16079 #[doc = "RC channel 4 value"]
16080 pub chan4_raw: u16,
16081 #[doc = "RC channel 5 value"]
16082 pub chan5_raw: u16,
16083 #[doc = "RC channel 6 value"]
16084 pub chan6_raw: u16,
16085 #[doc = "RC channel 7 value"]
16086 pub chan7_raw: u16,
16087 #[doc = "RC channel 8 value"]
16088 pub chan8_raw: u16,
16089 #[doc = "RC channel 9 value"]
16090 pub chan9_raw: u16,
16091 #[doc = "RC channel 10 value"]
16092 pub chan10_raw: u16,
16093 #[doc = "RC channel 11 value"]
16094 pub chan11_raw: u16,
16095 #[doc = "RC channel 12 value"]
16096 pub chan12_raw: u16,
16097 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
16098 pub rssi: u8,
16099}
16100impl HIL_RC_INPUTS_RAW_DATA {
16101 pub const ENCODED_LEN: usize = 33usize;
16102 pub const DEFAULT: Self = Self {
16103 time_usec: 0_u64,
16104 chan1_raw: 0_u16,
16105 chan2_raw: 0_u16,
16106 chan3_raw: 0_u16,
16107 chan4_raw: 0_u16,
16108 chan5_raw: 0_u16,
16109 chan6_raw: 0_u16,
16110 chan7_raw: 0_u16,
16111 chan8_raw: 0_u16,
16112 chan9_raw: 0_u16,
16113 chan10_raw: 0_u16,
16114 chan11_raw: 0_u16,
16115 chan12_raw: 0_u16,
16116 rssi: 0_u8,
16117 };
16118 #[cfg(feature = "arbitrary")]
16119 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16120 use arbitrary::{Arbitrary, Unstructured};
16121 let mut buf = [0u8; 1024];
16122 rng.fill_bytes(&mut buf);
16123 let mut unstructured = Unstructured::new(&buf);
16124 Self::arbitrary(&mut unstructured).unwrap_or_default()
16125 }
16126}
16127impl Default for HIL_RC_INPUTS_RAW_DATA {
16128 fn default() -> Self {
16129 Self::DEFAULT.clone()
16130 }
16131}
16132impl MessageData for HIL_RC_INPUTS_RAW_DATA {
16133 type Message = MavMessage;
16134 const ID: u32 = 92u32;
16135 const NAME: &'static str = "HIL_RC_INPUTS_RAW";
16136 const EXTRA_CRC: u8 = 54u8;
16137 const ENCODED_LEN: usize = 33usize;
16138 fn deser(
16139 _version: MavlinkVersion,
16140 __input: &[u8],
16141 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16142 let avail_len = __input.len();
16143 let mut payload_buf = [0; Self::ENCODED_LEN];
16144 let mut buf = if avail_len < Self::ENCODED_LEN {
16145 payload_buf[0..avail_len].copy_from_slice(__input);
16146 Bytes::new(&payload_buf)
16147 } else {
16148 Bytes::new(__input)
16149 };
16150 let mut __struct = Self::default();
16151 __struct.time_usec = buf.get_u64_le();
16152 __struct.chan1_raw = buf.get_u16_le();
16153 __struct.chan2_raw = buf.get_u16_le();
16154 __struct.chan3_raw = buf.get_u16_le();
16155 __struct.chan4_raw = buf.get_u16_le();
16156 __struct.chan5_raw = buf.get_u16_le();
16157 __struct.chan6_raw = buf.get_u16_le();
16158 __struct.chan7_raw = buf.get_u16_le();
16159 __struct.chan8_raw = buf.get_u16_le();
16160 __struct.chan9_raw = buf.get_u16_le();
16161 __struct.chan10_raw = buf.get_u16_le();
16162 __struct.chan11_raw = buf.get_u16_le();
16163 __struct.chan12_raw = buf.get_u16_le();
16164 __struct.rssi = buf.get_u8();
16165 Ok(__struct)
16166 }
16167 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16168 let mut __tmp = BytesMut::new(bytes);
16169 #[allow(clippy::absurd_extreme_comparisons)]
16170 #[allow(unused_comparisons)]
16171 if __tmp.remaining() < Self::ENCODED_LEN {
16172 panic!(
16173 "buffer is too small (need {} bytes, but got {})",
16174 Self::ENCODED_LEN,
16175 __tmp.remaining(),
16176 )
16177 }
16178 __tmp.put_u64_le(self.time_usec);
16179 __tmp.put_u16_le(self.chan1_raw);
16180 __tmp.put_u16_le(self.chan2_raw);
16181 __tmp.put_u16_le(self.chan3_raw);
16182 __tmp.put_u16_le(self.chan4_raw);
16183 __tmp.put_u16_le(self.chan5_raw);
16184 __tmp.put_u16_le(self.chan6_raw);
16185 __tmp.put_u16_le(self.chan7_raw);
16186 __tmp.put_u16_le(self.chan8_raw);
16187 __tmp.put_u16_le(self.chan9_raw);
16188 __tmp.put_u16_le(self.chan10_raw);
16189 __tmp.put_u16_le(self.chan11_raw);
16190 __tmp.put_u16_le(self.chan12_raw);
16191 __tmp.put_u8(self.rssi);
16192 if matches!(version, MavlinkVersion::V2) {
16193 let len = __tmp.len();
16194 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16195 } else {
16196 __tmp.len()
16197 }
16198 }
16199}
16200#[doc = "The IMU readings in SI units in NED body frame."]
16201#[doc = ""]
16202#[doc = "ID: 107"]
16203#[derive(Debug, Clone, PartialEq)]
16204#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16205#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16206#[cfg_attr(feature = "ts", derive(TS))]
16207#[cfg_attr(feature = "ts", ts(export))]
16208pub struct HIL_SENSOR_DATA {
16209 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16210 pub time_usec: u64,
16211 #[doc = "X acceleration"]
16212 pub xacc: f32,
16213 #[doc = "Y acceleration"]
16214 pub yacc: f32,
16215 #[doc = "Z acceleration"]
16216 pub zacc: f32,
16217 #[doc = "Angular speed around X axis in body frame"]
16218 pub xgyro: f32,
16219 #[doc = "Angular speed around Y axis in body frame"]
16220 pub ygyro: f32,
16221 #[doc = "Angular speed around Z axis in body frame"]
16222 pub zgyro: f32,
16223 #[doc = "X Magnetic field"]
16224 pub xmag: f32,
16225 #[doc = "Y Magnetic field"]
16226 pub ymag: f32,
16227 #[doc = "Z Magnetic field"]
16228 pub zmag: f32,
16229 #[doc = "Absolute pressure"]
16230 pub abs_pressure: f32,
16231 #[doc = "Differential pressure (airspeed)"]
16232 pub diff_pressure: f32,
16233 #[doc = "Altitude calculated from pressure"]
16234 pub pressure_alt: f32,
16235 #[doc = "Temperature"]
16236 pub temperature: f32,
16237 #[doc = "Bitmap for fields that have updated since last message"]
16238 pub fields_updated: HilSensorUpdatedFlags,
16239 #[doc = "Sensor ID (zero indexed). Used for multiple sensor inputs"]
16240 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16241 pub id: u8,
16242}
16243impl HIL_SENSOR_DATA {
16244 pub const ENCODED_LEN: usize = 65usize;
16245 pub const DEFAULT: Self = Self {
16246 time_usec: 0_u64,
16247 xacc: 0.0_f32,
16248 yacc: 0.0_f32,
16249 zacc: 0.0_f32,
16250 xgyro: 0.0_f32,
16251 ygyro: 0.0_f32,
16252 zgyro: 0.0_f32,
16253 xmag: 0.0_f32,
16254 ymag: 0.0_f32,
16255 zmag: 0.0_f32,
16256 abs_pressure: 0.0_f32,
16257 diff_pressure: 0.0_f32,
16258 pressure_alt: 0.0_f32,
16259 temperature: 0.0_f32,
16260 fields_updated: HilSensorUpdatedFlags::DEFAULT,
16261 id: 0_u8,
16262 };
16263 #[cfg(feature = "arbitrary")]
16264 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16265 use arbitrary::{Arbitrary, Unstructured};
16266 let mut buf = [0u8; 1024];
16267 rng.fill_bytes(&mut buf);
16268 let mut unstructured = Unstructured::new(&buf);
16269 Self::arbitrary(&mut unstructured).unwrap_or_default()
16270 }
16271}
16272impl Default for HIL_SENSOR_DATA {
16273 fn default() -> Self {
16274 Self::DEFAULT.clone()
16275 }
16276}
16277impl MessageData for HIL_SENSOR_DATA {
16278 type Message = MavMessage;
16279 const ID: u32 = 107u32;
16280 const NAME: &'static str = "HIL_SENSOR";
16281 const EXTRA_CRC: u8 = 108u8;
16282 const ENCODED_LEN: usize = 65usize;
16283 fn deser(
16284 _version: MavlinkVersion,
16285 __input: &[u8],
16286 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16287 let avail_len = __input.len();
16288 let mut payload_buf = [0; Self::ENCODED_LEN];
16289 let mut buf = if avail_len < Self::ENCODED_LEN {
16290 payload_buf[0..avail_len].copy_from_slice(__input);
16291 Bytes::new(&payload_buf)
16292 } else {
16293 Bytes::new(__input)
16294 };
16295 let mut __struct = Self::default();
16296 __struct.time_usec = buf.get_u64_le();
16297 __struct.xacc = buf.get_f32_le();
16298 __struct.yacc = buf.get_f32_le();
16299 __struct.zacc = buf.get_f32_le();
16300 __struct.xgyro = buf.get_f32_le();
16301 __struct.ygyro = buf.get_f32_le();
16302 __struct.zgyro = buf.get_f32_le();
16303 __struct.xmag = buf.get_f32_le();
16304 __struct.ymag = buf.get_f32_le();
16305 __struct.zmag = buf.get_f32_le();
16306 __struct.abs_pressure = buf.get_f32_le();
16307 __struct.diff_pressure = buf.get_f32_le();
16308 __struct.pressure_alt = buf.get_f32_le();
16309 __struct.temperature = buf.get_f32_le();
16310 let tmp = buf.get_u32_le();
16311 __struct.fields_updated = HilSensorUpdatedFlags::from_bits(tmp).ok_or(
16312 ::mavlink_core::error::ParserError::InvalidFlag {
16313 flag_type: "HilSensorUpdatedFlags",
16314 value: tmp as u64,
16315 },
16316 )?;
16317 __struct.id = buf.get_u8();
16318 Ok(__struct)
16319 }
16320 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16321 let mut __tmp = BytesMut::new(bytes);
16322 #[allow(clippy::absurd_extreme_comparisons)]
16323 #[allow(unused_comparisons)]
16324 if __tmp.remaining() < Self::ENCODED_LEN {
16325 panic!(
16326 "buffer is too small (need {} bytes, but got {})",
16327 Self::ENCODED_LEN,
16328 __tmp.remaining(),
16329 )
16330 }
16331 __tmp.put_u64_le(self.time_usec);
16332 __tmp.put_f32_le(self.xacc);
16333 __tmp.put_f32_le(self.yacc);
16334 __tmp.put_f32_le(self.zacc);
16335 __tmp.put_f32_le(self.xgyro);
16336 __tmp.put_f32_le(self.ygyro);
16337 __tmp.put_f32_le(self.zgyro);
16338 __tmp.put_f32_le(self.xmag);
16339 __tmp.put_f32_le(self.ymag);
16340 __tmp.put_f32_le(self.zmag);
16341 __tmp.put_f32_le(self.abs_pressure);
16342 __tmp.put_f32_le(self.diff_pressure);
16343 __tmp.put_f32_le(self.pressure_alt);
16344 __tmp.put_f32_le(self.temperature);
16345 __tmp.put_u32_le(self.fields_updated.bits());
16346 if matches!(version, MavlinkVersion::V2) {
16347 __tmp.put_u8(self.id);
16348 let len = __tmp.len();
16349 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16350 } else {
16351 __tmp.len()
16352 }
16353 }
16354}
16355#[deprecated = "Suffers from missing airspeed fields and singularities due to Euler angles. See `HIL_STATE_QUATERNION` (Deprecated since 2013-07)"]
16356#[doc = "Sent from simulation to autopilot. This packet is useful for high throughput applications such as hardware in the loop simulations."]
16357#[doc = ""]
16358#[doc = "ID: 90"]
16359#[derive(Debug, Clone, PartialEq)]
16360#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16361#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16362#[cfg_attr(feature = "ts", derive(TS))]
16363#[cfg_attr(feature = "ts", ts(export))]
16364pub struct HIL_STATE_DATA {
16365 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16366 pub time_usec: u64,
16367 #[doc = "Roll angle"]
16368 pub roll: f32,
16369 #[doc = "Pitch angle"]
16370 pub pitch: f32,
16371 #[doc = "Yaw angle"]
16372 pub yaw: f32,
16373 #[doc = "Body frame roll / phi angular speed"]
16374 pub rollspeed: f32,
16375 #[doc = "Body frame pitch / theta angular speed"]
16376 pub pitchspeed: f32,
16377 #[doc = "Body frame yaw / psi angular speed"]
16378 pub yawspeed: f32,
16379 #[doc = "Latitude"]
16380 pub lat: i32,
16381 #[doc = "Longitude"]
16382 pub lon: i32,
16383 #[doc = "Altitude"]
16384 pub alt: i32,
16385 #[doc = "Ground X Speed (Latitude)"]
16386 pub vx: i16,
16387 #[doc = "Ground Y Speed (Longitude)"]
16388 pub vy: i16,
16389 #[doc = "Ground Z Speed (Altitude)"]
16390 pub vz: i16,
16391 #[doc = "X acceleration"]
16392 pub xacc: i16,
16393 #[doc = "Y acceleration"]
16394 pub yacc: i16,
16395 #[doc = "Z acceleration"]
16396 pub zacc: i16,
16397}
16398impl HIL_STATE_DATA {
16399 pub const ENCODED_LEN: usize = 56usize;
16400 pub const DEFAULT: Self = Self {
16401 time_usec: 0_u64,
16402 roll: 0.0_f32,
16403 pitch: 0.0_f32,
16404 yaw: 0.0_f32,
16405 rollspeed: 0.0_f32,
16406 pitchspeed: 0.0_f32,
16407 yawspeed: 0.0_f32,
16408 lat: 0_i32,
16409 lon: 0_i32,
16410 alt: 0_i32,
16411 vx: 0_i16,
16412 vy: 0_i16,
16413 vz: 0_i16,
16414 xacc: 0_i16,
16415 yacc: 0_i16,
16416 zacc: 0_i16,
16417 };
16418 #[cfg(feature = "arbitrary")]
16419 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16420 use arbitrary::{Arbitrary, Unstructured};
16421 let mut buf = [0u8; 1024];
16422 rng.fill_bytes(&mut buf);
16423 let mut unstructured = Unstructured::new(&buf);
16424 Self::arbitrary(&mut unstructured).unwrap_or_default()
16425 }
16426}
16427impl Default for HIL_STATE_DATA {
16428 fn default() -> Self {
16429 Self::DEFAULT.clone()
16430 }
16431}
16432impl MessageData for HIL_STATE_DATA {
16433 type Message = MavMessage;
16434 const ID: u32 = 90u32;
16435 const NAME: &'static str = "HIL_STATE";
16436 const EXTRA_CRC: u8 = 183u8;
16437 const ENCODED_LEN: usize = 56usize;
16438 fn deser(
16439 _version: MavlinkVersion,
16440 __input: &[u8],
16441 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16442 let avail_len = __input.len();
16443 let mut payload_buf = [0; Self::ENCODED_LEN];
16444 let mut buf = if avail_len < Self::ENCODED_LEN {
16445 payload_buf[0..avail_len].copy_from_slice(__input);
16446 Bytes::new(&payload_buf)
16447 } else {
16448 Bytes::new(__input)
16449 };
16450 let mut __struct = Self::default();
16451 __struct.time_usec = buf.get_u64_le();
16452 __struct.roll = buf.get_f32_le();
16453 __struct.pitch = buf.get_f32_le();
16454 __struct.yaw = buf.get_f32_le();
16455 __struct.rollspeed = buf.get_f32_le();
16456 __struct.pitchspeed = buf.get_f32_le();
16457 __struct.yawspeed = buf.get_f32_le();
16458 __struct.lat = buf.get_i32_le();
16459 __struct.lon = buf.get_i32_le();
16460 __struct.alt = buf.get_i32_le();
16461 __struct.vx = buf.get_i16_le();
16462 __struct.vy = buf.get_i16_le();
16463 __struct.vz = buf.get_i16_le();
16464 __struct.xacc = buf.get_i16_le();
16465 __struct.yacc = buf.get_i16_le();
16466 __struct.zacc = buf.get_i16_le();
16467 Ok(__struct)
16468 }
16469 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16470 let mut __tmp = BytesMut::new(bytes);
16471 #[allow(clippy::absurd_extreme_comparisons)]
16472 #[allow(unused_comparisons)]
16473 if __tmp.remaining() < Self::ENCODED_LEN {
16474 panic!(
16475 "buffer is too small (need {} bytes, but got {})",
16476 Self::ENCODED_LEN,
16477 __tmp.remaining(),
16478 )
16479 }
16480 __tmp.put_u64_le(self.time_usec);
16481 __tmp.put_f32_le(self.roll);
16482 __tmp.put_f32_le(self.pitch);
16483 __tmp.put_f32_le(self.yaw);
16484 __tmp.put_f32_le(self.rollspeed);
16485 __tmp.put_f32_le(self.pitchspeed);
16486 __tmp.put_f32_le(self.yawspeed);
16487 __tmp.put_i32_le(self.lat);
16488 __tmp.put_i32_le(self.lon);
16489 __tmp.put_i32_le(self.alt);
16490 __tmp.put_i16_le(self.vx);
16491 __tmp.put_i16_le(self.vy);
16492 __tmp.put_i16_le(self.vz);
16493 __tmp.put_i16_le(self.xacc);
16494 __tmp.put_i16_le(self.yacc);
16495 __tmp.put_i16_le(self.zacc);
16496 if matches!(version, MavlinkVersion::V2) {
16497 let len = __tmp.len();
16498 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16499 } else {
16500 __tmp.len()
16501 }
16502 }
16503}
16504#[doc = "Sent from simulation to autopilot, avoids in contrast to HIL_STATE singularities. This packet is useful for high throughput applications such as hardware in the loop simulations."]
16505#[doc = ""]
16506#[doc = "ID: 115"]
16507#[derive(Debug, Clone, PartialEq)]
16508#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16509#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16510#[cfg_attr(feature = "ts", derive(TS))]
16511#[cfg_attr(feature = "ts", ts(export))]
16512pub struct HIL_STATE_QUATERNION_DATA {
16513 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16514 pub time_usec: u64,
16515 #[doc = "Vehicle attitude expressed as normalized quaternion in w, x, y, z order (with 1 0 0 0 being the null-rotation)"]
16516 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16517 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
16518 pub attitude_quaternion: [f32; 4],
16519 #[doc = "Body frame roll / phi angular speed"]
16520 pub rollspeed: f32,
16521 #[doc = "Body frame pitch / theta angular speed"]
16522 pub pitchspeed: f32,
16523 #[doc = "Body frame yaw / psi angular speed"]
16524 pub yawspeed: f32,
16525 #[doc = "Latitude"]
16526 pub lat: i32,
16527 #[doc = "Longitude"]
16528 pub lon: i32,
16529 #[doc = "Altitude"]
16530 pub alt: i32,
16531 #[doc = "Ground X Speed (Latitude)"]
16532 pub vx: i16,
16533 #[doc = "Ground Y Speed (Longitude)"]
16534 pub vy: i16,
16535 #[doc = "Ground Z Speed (Altitude)"]
16536 pub vz: i16,
16537 #[doc = "Indicated airspeed"]
16538 pub ind_airspeed: u16,
16539 #[doc = "True airspeed"]
16540 pub true_airspeed: u16,
16541 #[doc = "X acceleration"]
16542 pub xacc: i16,
16543 #[doc = "Y acceleration"]
16544 pub yacc: i16,
16545 #[doc = "Z acceleration"]
16546 pub zacc: i16,
16547}
16548impl HIL_STATE_QUATERNION_DATA {
16549 pub const ENCODED_LEN: usize = 64usize;
16550 pub const DEFAULT: Self = Self {
16551 time_usec: 0_u64,
16552 attitude_quaternion: [0.0_f32; 4usize],
16553 rollspeed: 0.0_f32,
16554 pitchspeed: 0.0_f32,
16555 yawspeed: 0.0_f32,
16556 lat: 0_i32,
16557 lon: 0_i32,
16558 alt: 0_i32,
16559 vx: 0_i16,
16560 vy: 0_i16,
16561 vz: 0_i16,
16562 ind_airspeed: 0_u16,
16563 true_airspeed: 0_u16,
16564 xacc: 0_i16,
16565 yacc: 0_i16,
16566 zacc: 0_i16,
16567 };
16568 #[cfg(feature = "arbitrary")]
16569 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16570 use arbitrary::{Arbitrary, Unstructured};
16571 let mut buf = [0u8; 1024];
16572 rng.fill_bytes(&mut buf);
16573 let mut unstructured = Unstructured::new(&buf);
16574 Self::arbitrary(&mut unstructured).unwrap_or_default()
16575 }
16576}
16577impl Default for HIL_STATE_QUATERNION_DATA {
16578 fn default() -> Self {
16579 Self::DEFAULT.clone()
16580 }
16581}
16582impl MessageData for HIL_STATE_QUATERNION_DATA {
16583 type Message = MavMessage;
16584 const ID: u32 = 115u32;
16585 const NAME: &'static str = "HIL_STATE_QUATERNION";
16586 const EXTRA_CRC: u8 = 4u8;
16587 const ENCODED_LEN: usize = 64usize;
16588 fn deser(
16589 _version: MavlinkVersion,
16590 __input: &[u8],
16591 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16592 let avail_len = __input.len();
16593 let mut payload_buf = [0; Self::ENCODED_LEN];
16594 let mut buf = if avail_len < Self::ENCODED_LEN {
16595 payload_buf[0..avail_len].copy_from_slice(__input);
16596 Bytes::new(&payload_buf)
16597 } else {
16598 Bytes::new(__input)
16599 };
16600 let mut __struct = Self::default();
16601 __struct.time_usec = buf.get_u64_le();
16602 for v in &mut __struct.attitude_quaternion {
16603 let val = buf.get_f32_le();
16604 *v = val;
16605 }
16606 __struct.rollspeed = buf.get_f32_le();
16607 __struct.pitchspeed = buf.get_f32_le();
16608 __struct.yawspeed = buf.get_f32_le();
16609 __struct.lat = buf.get_i32_le();
16610 __struct.lon = buf.get_i32_le();
16611 __struct.alt = buf.get_i32_le();
16612 __struct.vx = buf.get_i16_le();
16613 __struct.vy = buf.get_i16_le();
16614 __struct.vz = buf.get_i16_le();
16615 __struct.ind_airspeed = buf.get_u16_le();
16616 __struct.true_airspeed = buf.get_u16_le();
16617 __struct.xacc = buf.get_i16_le();
16618 __struct.yacc = buf.get_i16_le();
16619 __struct.zacc = buf.get_i16_le();
16620 Ok(__struct)
16621 }
16622 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16623 let mut __tmp = BytesMut::new(bytes);
16624 #[allow(clippy::absurd_extreme_comparisons)]
16625 #[allow(unused_comparisons)]
16626 if __tmp.remaining() < Self::ENCODED_LEN {
16627 panic!(
16628 "buffer is too small (need {} bytes, but got {})",
16629 Self::ENCODED_LEN,
16630 __tmp.remaining(),
16631 )
16632 }
16633 __tmp.put_u64_le(self.time_usec);
16634 for val in &self.attitude_quaternion {
16635 __tmp.put_f32_le(*val);
16636 }
16637 __tmp.put_f32_le(self.rollspeed);
16638 __tmp.put_f32_le(self.pitchspeed);
16639 __tmp.put_f32_le(self.yawspeed);
16640 __tmp.put_i32_le(self.lat);
16641 __tmp.put_i32_le(self.lon);
16642 __tmp.put_i32_le(self.alt);
16643 __tmp.put_i16_le(self.vx);
16644 __tmp.put_i16_le(self.vy);
16645 __tmp.put_i16_le(self.vz);
16646 __tmp.put_u16_le(self.ind_airspeed);
16647 __tmp.put_u16_le(self.true_airspeed);
16648 __tmp.put_i16_le(self.xacc);
16649 __tmp.put_i16_le(self.yacc);
16650 __tmp.put_i16_le(self.zacc);
16651 if matches!(version, MavlinkVersion::V2) {
16652 let len = __tmp.len();
16653 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16654 } else {
16655 __tmp.len()
16656 }
16657 }
16658}
16659#[doc = "Contains the home position. \tThe home position is the default position that the system will return to and land on. \tThe position must be set automatically by the system during the takeoff, and may also be explicitly set using MAV_CMD_DO_SET_HOME. \tThe global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. \tUnder normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. \tThe approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: this message can be requested by sending the MAV_CMD_REQUEST_MESSAGE with param1=242 (or the deprecated MAV_CMD_GET_HOME_POSITION command)."]
16660#[doc = ""]
16661#[doc = "ID: 242"]
16662#[derive(Debug, Clone, PartialEq)]
16663#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16664#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16665#[cfg_attr(feature = "ts", derive(TS))]
16666#[cfg_attr(feature = "ts", ts(export))]
16667pub struct HOME_POSITION_DATA {
16668 #[doc = "Latitude (WGS84)"]
16669 pub latitude: i32,
16670 #[doc = "Longitude (WGS84)"]
16671 pub longitude: i32,
16672 #[doc = "Altitude (MSL). Positive for up."]
16673 pub altitude: i32,
16674 #[doc = "Local X position of this position in the local coordinate frame (NED)"]
16675 pub x: f32,
16676 #[doc = "Local Y position of this position in the local coordinate frame (NED)"]
16677 pub y: f32,
16678 #[doc = "Local Z position of this position in the local coordinate frame (NED: positive \"down\")"]
16679 pub z: f32,
16680 #[doc = "Quaternion indicating world-to-surface-normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground. All fields should be set to NaN if an accurate quaternion for both heading and surface slope cannot be supplied."]
16681 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16682 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
16683 pub q: [f32; 4],
16684 #[doc = "Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
16685 pub approach_x: f32,
16686 #[doc = "Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
16687 pub approach_y: f32,
16688 #[doc = "Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
16689 pub approach_z: f32,
16690 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16691 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16692 pub time_usec: u64,
16693}
16694impl HOME_POSITION_DATA {
16695 pub const ENCODED_LEN: usize = 60usize;
16696 pub const DEFAULT: Self = Self {
16697 latitude: 0_i32,
16698 longitude: 0_i32,
16699 altitude: 0_i32,
16700 x: 0.0_f32,
16701 y: 0.0_f32,
16702 z: 0.0_f32,
16703 q: [0.0_f32; 4usize],
16704 approach_x: 0.0_f32,
16705 approach_y: 0.0_f32,
16706 approach_z: 0.0_f32,
16707 time_usec: 0_u64,
16708 };
16709 #[cfg(feature = "arbitrary")]
16710 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16711 use arbitrary::{Arbitrary, Unstructured};
16712 let mut buf = [0u8; 1024];
16713 rng.fill_bytes(&mut buf);
16714 let mut unstructured = Unstructured::new(&buf);
16715 Self::arbitrary(&mut unstructured).unwrap_or_default()
16716 }
16717}
16718impl Default for HOME_POSITION_DATA {
16719 fn default() -> Self {
16720 Self::DEFAULT.clone()
16721 }
16722}
16723impl MessageData for HOME_POSITION_DATA {
16724 type Message = MavMessage;
16725 const ID: u32 = 242u32;
16726 const NAME: &'static str = "HOME_POSITION";
16727 const EXTRA_CRC: u8 = 104u8;
16728 const ENCODED_LEN: usize = 60usize;
16729 fn deser(
16730 _version: MavlinkVersion,
16731 __input: &[u8],
16732 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16733 let avail_len = __input.len();
16734 let mut payload_buf = [0; Self::ENCODED_LEN];
16735 let mut buf = if avail_len < Self::ENCODED_LEN {
16736 payload_buf[0..avail_len].copy_from_slice(__input);
16737 Bytes::new(&payload_buf)
16738 } else {
16739 Bytes::new(__input)
16740 };
16741 let mut __struct = Self::default();
16742 __struct.latitude = buf.get_i32_le();
16743 __struct.longitude = buf.get_i32_le();
16744 __struct.altitude = buf.get_i32_le();
16745 __struct.x = buf.get_f32_le();
16746 __struct.y = buf.get_f32_le();
16747 __struct.z = buf.get_f32_le();
16748 for v in &mut __struct.q {
16749 let val = buf.get_f32_le();
16750 *v = val;
16751 }
16752 __struct.approach_x = buf.get_f32_le();
16753 __struct.approach_y = buf.get_f32_le();
16754 __struct.approach_z = buf.get_f32_le();
16755 __struct.time_usec = buf.get_u64_le();
16756 Ok(__struct)
16757 }
16758 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16759 let mut __tmp = BytesMut::new(bytes);
16760 #[allow(clippy::absurd_extreme_comparisons)]
16761 #[allow(unused_comparisons)]
16762 if __tmp.remaining() < Self::ENCODED_LEN {
16763 panic!(
16764 "buffer is too small (need {} bytes, but got {})",
16765 Self::ENCODED_LEN,
16766 __tmp.remaining(),
16767 )
16768 }
16769 __tmp.put_i32_le(self.latitude);
16770 __tmp.put_i32_le(self.longitude);
16771 __tmp.put_i32_le(self.altitude);
16772 __tmp.put_f32_le(self.x);
16773 __tmp.put_f32_le(self.y);
16774 __tmp.put_f32_le(self.z);
16775 for val in &self.q {
16776 __tmp.put_f32_le(*val);
16777 }
16778 __tmp.put_f32_le(self.approach_x);
16779 __tmp.put_f32_le(self.approach_y);
16780 __tmp.put_f32_le(self.approach_z);
16781 if matches!(version, MavlinkVersion::V2) {
16782 __tmp.put_u64_le(self.time_usec);
16783 let len = __tmp.len();
16784 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16785 } else {
16786 __tmp.len()
16787 }
16788 }
16789}
16790#[doc = "Temperature and humidity from hygrometer."]
16791#[doc = ""]
16792#[doc = "ID: 12920"]
16793#[derive(Debug, Clone, PartialEq)]
16794#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16795#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16796#[cfg_attr(feature = "ts", derive(TS))]
16797#[cfg_attr(feature = "ts", ts(export))]
16798pub struct HYGROMETER_SENSOR_DATA {
16799 #[doc = "Temperature"]
16800 pub temperature: i16,
16801 #[doc = "Humidity"]
16802 pub humidity: u16,
16803 #[doc = "Hygrometer ID"]
16804 pub id: u8,
16805}
16806impl HYGROMETER_SENSOR_DATA {
16807 pub const ENCODED_LEN: usize = 5usize;
16808 pub const DEFAULT: Self = Self {
16809 temperature: 0_i16,
16810 humidity: 0_u16,
16811 id: 0_u8,
16812 };
16813 #[cfg(feature = "arbitrary")]
16814 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16815 use arbitrary::{Arbitrary, Unstructured};
16816 let mut buf = [0u8; 1024];
16817 rng.fill_bytes(&mut buf);
16818 let mut unstructured = Unstructured::new(&buf);
16819 Self::arbitrary(&mut unstructured).unwrap_or_default()
16820 }
16821}
16822impl Default for HYGROMETER_SENSOR_DATA {
16823 fn default() -> Self {
16824 Self::DEFAULT.clone()
16825 }
16826}
16827impl MessageData for HYGROMETER_SENSOR_DATA {
16828 type Message = MavMessage;
16829 const ID: u32 = 12920u32;
16830 const NAME: &'static str = "HYGROMETER_SENSOR";
16831 const EXTRA_CRC: u8 = 20u8;
16832 const ENCODED_LEN: usize = 5usize;
16833 fn deser(
16834 _version: MavlinkVersion,
16835 __input: &[u8],
16836 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16837 let avail_len = __input.len();
16838 let mut payload_buf = [0; Self::ENCODED_LEN];
16839 let mut buf = if avail_len < Self::ENCODED_LEN {
16840 payload_buf[0..avail_len].copy_from_slice(__input);
16841 Bytes::new(&payload_buf)
16842 } else {
16843 Bytes::new(__input)
16844 };
16845 let mut __struct = Self::default();
16846 __struct.temperature = buf.get_i16_le();
16847 __struct.humidity = buf.get_u16_le();
16848 __struct.id = buf.get_u8();
16849 Ok(__struct)
16850 }
16851 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16852 let mut __tmp = BytesMut::new(bytes);
16853 #[allow(clippy::absurd_extreme_comparisons)]
16854 #[allow(unused_comparisons)]
16855 if __tmp.remaining() < Self::ENCODED_LEN {
16856 panic!(
16857 "buffer is too small (need {} bytes, but got {})",
16858 Self::ENCODED_LEN,
16859 __tmp.remaining(),
16860 )
16861 }
16862 __tmp.put_i16_le(self.temperature);
16863 __tmp.put_u16_le(self.humidity);
16864 __tmp.put_u8(self.id);
16865 if matches!(version, MavlinkVersion::V2) {
16866 let len = __tmp.len();
16867 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16868 } else {
16869 __tmp.len()
16870 }
16871 }
16872}
16873#[doc = "Illuminator status."]
16874#[doc = ""]
16875#[doc = "ID: 440"]
16876#[derive(Debug, Clone, PartialEq)]
16877#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16878#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16879#[cfg_attr(feature = "ts", derive(TS))]
16880#[cfg_attr(feature = "ts", ts(export))]
16881pub struct ILLUMINATOR_STATUS_DATA {
16882 #[doc = "Time since the start-up of the illuminator in ms"]
16883 pub uptime_ms: u32,
16884 #[doc = "Errors"]
16885 pub error_status: IlluminatorErrorFlags,
16886 #[doc = "Illuminator brightness"]
16887 pub brightness: f32,
16888 #[doc = "Illuminator strobing period in seconds"]
16889 pub strobe_period: f32,
16890 #[doc = "Illuminator strobing duty cycle"]
16891 pub strobe_duty_cycle: f32,
16892 #[doc = "Temperature in Celsius"]
16893 pub temp_c: f32,
16894 #[doc = "Minimum strobing period in seconds"]
16895 pub min_strobe_period: f32,
16896 #[doc = "Maximum strobing period in seconds"]
16897 pub max_strobe_period: f32,
16898 #[doc = "0: Illuminators OFF, 1: Illuminators ON"]
16899 pub enable: u8,
16900 #[doc = "Supported illuminator modes"]
16901 pub mode_bitmask: IlluminatorMode,
16902 #[doc = "Illuminator mode"]
16903 pub mode: IlluminatorMode,
16904}
16905impl ILLUMINATOR_STATUS_DATA {
16906 pub const ENCODED_LEN: usize = 35usize;
16907 pub const DEFAULT: Self = Self {
16908 uptime_ms: 0_u32,
16909 error_status: IlluminatorErrorFlags::DEFAULT,
16910 brightness: 0.0_f32,
16911 strobe_period: 0.0_f32,
16912 strobe_duty_cycle: 0.0_f32,
16913 temp_c: 0.0_f32,
16914 min_strobe_period: 0.0_f32,
16915 max_strobe_period: 0.0_f32,
16916 enable: 0_u8,
16917 mode_bitmask: IlluminatorMode::DEFAULT,
16918 mode: IlluminatorMode::DEFAULT,
16919 };
16920 #[cfg(feature = "arbitrary")]
16921 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16922 use arbitrary::{Arbitrary, Unstructured};
16923 let mut buf = [0u8; 1024];
16924 rng.fill_bytes(&mut buf);
16925 let mut unstructured = Unstructured::new(&buf);
16926 Self::arbitrary(&mut unstructured).unwrap_or_default()
16927 }
16928}
16929impl Default for ILLUMINATOR_STATUS_DATA {
16930 fn default() -> Self {
16931 Self::DEFAULT.clone()
16932 }
16933}
16934impl MessageData for ILLUMINATOR_STATUS_DATA {
16935 type Message = MavMessage;
16936 const ID: u32 = 440u32;
16937 const NAME: &'static str = "ILLUMINATOR_STATUS";
16938 const EXTRA_CRC: u8 = 66u8;
16939 const ENCODED_LEN: usize = 35usize;
16940 fn deser(
16941 _version: MavlinkVersion,
16942 __input: &[u8],
16943 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16944 let avail_len = __input.len();
16945 let mut payload_buf = [0; Self::ENCODED_LEN];
16946 let mut buf = if avail_len < Self::ENCODED_LEN {
16947 payload_buf[0..avail_len].copy_from_slice(__input);
16948 Bytes::new(&payload_buf)
16949 } else {
16950 Bytes::new(__input)
16951 };
16952 let mut __struct = Self::default();
16953 __struct.uptime_ms = buf.get_u32_le();
16954 let tmp = buf.get_u32_le();
16955 __struct.error_status = IlluminatorErrorFlags::from_bits(tmp).ok_or(
16956 ::mavlink_core::error::ParserError::InvalidFlag {
16957 flag_type: "IlluminatorErrorFlags",
16958 value: tmp as u64,
16959 },
16960 )?;
16961 __struct.brightness = buf.get_f32_le();
16962 __struct.strobe_period = buf.get_f32_le();
16963 __struct.strobe_duty_cycle = buf.get_f32_le();
16964 __struct.temp_c = buf.get_f32_le();
16965 __struct.min_strobe_period = buf.get_f32_le();
16966 __struct.max_strobe_period = buf.get_f32_le();
16967 __struct.enable = buf.get_u8();
16968 let tmp = buf.get_u8();
16969 __struct.mode_bitmask =
16970 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16971 enum_type: "IlluminatorMode",
16972 value: tmp as u64,
16973 })?;
16974 let tmp = buf.get_u8();
16975 __struct.mode =
16976 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16977 enum_type: "IlluminatorMode",
16978 value: tmp as u64,
16979 })?;
16980 Ok(__struct)
16981 }
16982 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16983 let mut __tmp = BytesMut::new(bytes);
16984 #[allow(clippy::absurd_extreme_comparisons)]
16985 #[allow(unused_comparisons)]
16986 if __tmp.remaining() < Self::ENCODED_LEN {
16987 panic!(
16988 "buffer is too small (need {} bytes, but got {})",
16989 Self::ENCODED_LEN,
16990 __tmp.remaining(),
16991 )
16992 }
16993 __tmp.put_u32_le(self.uptime_ms);
16994 __tmp.put_u32_le(self.error_status.bits());
16995 __tmp.put_f32_le(self.brightness);
16996 __tmp.put_f32_le(self.strobe_period);
16997 __tmp.put_f32_le(self.strobe_duty_cycle);
16998 __tmp.put_f32_le(self.temp_c);
16999 __tmp.put_f32_le(self.min_strobe_period);
17000 __tmp.put_f32_le(self.max_strobe_period);
17001 __tmp.put_u8(self.enable);
17002 __tmp.put_u8(self.mode_bitmask as u8);
17003 __tmp.put_u8(self.mode as u8);
17004 if matches!(version, MavlinkVersion::V2) {
17005 let len = __tmp.len();
17006 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17007 } else {
17008 __tmp.len()
17009 }
17010 }
17011}
17012#[doc = "Status of the Iridium SBD link."]
17013#[doc = ""]
17014#[doc = "ID: 335"]
17015#[derive(Debug, Clone, PartialEq)]
17016#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17017#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17018#[cfg_attr(feature = "ts", derive(TS))]
17019#[cfg_attr(feature = "ts", ts(export))]
17020pub struct ISBD_LINK_STATUS_DATA {
17021 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17022 pub timestamp: u64,
17023 #[doc = "Timestamp of the last successful sbd session. The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17024 pub last_heartbeat: u64,
17025 #[doc = "Number of failed SBD sessions."]
17026 pub failed_sessions: u16,
17027 #[doc = "Number of successful SBD sessions."]
17028 pub successful_sessions: u16,
17029 #[doc = "Signal quality equal to the number of bars displayed on the ISU signal strength indicator. Range is 0 to 5, where 0 indicates no signal and 5 indicates maximum signal strength."]
17030 pub signal_quality: u8,
17031 #[doc = "1: Ring call pending, 0: No call pending."]
17032 pub ring_pending: u8,
17033 #[doc = "1: Transmission session pending, 0: No transmission session pending."]
17034 pub tx_session_pending: u8,
17035 #[doc = "1: Receiving session pending, 0: No receiving session pending."]
17036 pub rx_session_pending: u8,
17037}
17038impl ISBD_LINK_STATUS_DATA {
17039 pub const ENCODED_LEN: usize = 24usize;
17040 pub const DEFAULT: Self = Self {
17041 timestamp: 0_u64,
17042 last_heartbeat: 0_u64,
17043 failed_sessions: 0_u16,
17044 successful_sessions: 0_u16,
17045 signal_quality: 0_u8,
17046 ring_pending: 0_u8,
17047 tx_session_pending: 0_u8,
17048 rx_session_pending: 0_u8,
17049 };
17050 #[cfg(feature = "arbitrary")]
17051 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17052 use arbitrary::{Arbitrary, Unstructured};
17053 let mut buf = [0u8; 1024];
17054 rng.fill_bytes(&mut buf);
17055 let mut unstructured = Unstructured::new(&buf);
17056 Self::arbitrary(&mut unstructured).unwrap_or_default()
17057 }
17058}
17059impl Default for ISBD_LINK_STATUS_DATA {
17060 fn default() -> Self {
17061 Self::DEFAULT.clone()
17062 }
17063}
17064impl MessageData for ISBD_LINK_STATUS_DATA {
17065 type Message = MavMessage;
17066 const ID: u32 = 335u32;
17067 const NAME: &'static str = "ISBD_LINK_STATUS";
17068 const EXTRA_CRC: u8 = 225u8;
17069 const ENCODED_LEN: usize = 24usize;
17070 fn deser(
17071 _version: MavlinkVersion,
17072 __input: &[u8],
17073 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17074 let avail_len = __input.len();
17075 let mut payload_buf = [0; Self::ENCODED_LEN];
17076 let mut buf = if avail_len < Self::ENCODED_LEN {
17077 payload_buf[0..avail_len].copy_from_slice(__input);
17078 Bytes::new(&payload_buf)
17079 } else {
17080 Bytes::new(__input)
17081 };
17082 let mut __struct = Self::default();
17083 __struct.timestamp = buf.get_u64_le();
17084 __struct.last_heartbeat = buf.get_u64_le();
17085 __struct.failed_sessions = buf.get_u16_le();
17086 __struct.successful_sessions = buf.get_u16_le();
17087 __struct.signal_quality = buf.get_u8();
17088 __struct.ring_pending = buf.get_u8();
17089 __struct.tx_session_pending = buf.get_u8();
17090 __struct.rx_session_pending = buf.get_u8();
17091 Ok(__struct)
17092 }
17093 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17094 let mut __tmp = BytesMut::new(bytes);
17095 #[allow(clippy::absurd_extreme_comparisons)]
17096 #[allow(unused_comparisons)]
17097 if __tmp.remaining() < Self::ENCODED_LEN {
17098 panic!(
17099 "buffer is too small (need {} bytes, but got {})",
17100 Self::ENCODED_LEN,
17101 __tmp.remaining(),
17102 )
17103 }
17104 __tmp.put_u64_le(self.timestamp);
17105 __tmp.put_u64_le(self.last_heartbeat);
17106 __tmp.put_u16_le(self.failed_sessions);
17107 __tmp.put_u16_le(self.successful_sessions);
17108 __tmp.put_u8(self.signal_quality);
17109 __tmp.put_u8(self.ring_pending);
17110 __tmp.put_u8(self.tx_session_pending);
17111 __tmp.put_u8(self.rx_session_pending);
17112 if matches!(version, MavlinkVersion::V2) {
17113 let len = __tmp.len();
17114 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17115 } else {
17116 __tmp.len()
17117 }
17118 }
17119}
17120#[doc = "The location of a landing target. See: <https://mavlink.io/en/services/landing_target.html>."]
17121#[doc = ""]
17122#[doc = "ID: 149"]
17123#[derive(Debug, Clone, PartialEq)]
17124#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17125#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17126#[cfg_attr(feature = "ts", derive(TS))]
17127#[cfg_attr(feature = "ts", ts(export))]
17128pub struct LANDING_TARGET_DATA {
17129 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17130 pub time_usec: u64,
17131 #[doc = "X-axis angular offset of the target from the center of the image"]
17132 pub angle_x: f32,
17133 #[doc = "Y-axis angular offset of the target from the center of the image"]
17134 pub angle_y: f32,
17135 #[doc = "Distance to the target from the vehicle"]
17136 pub distance: f32,
17137 #[doc = "Size of target along x-axis"]
17138 pub size_x: f32,
17139 #[doc = "Size of target along y-axis"]
17140 pub size_y: f32,
17141 #[doc = "The ID of the target if multiple targets are present"]
17142 pub target_num: u8,
17143 #[doc = "Coordinate frame used for following fields."]
17144 pub frame: MavFrame,
17145 #[doc = "X Position of the landing target in MAV_FRAME"]
17146 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17147 pub x: f32,
17148 #[doc = "Y Position of the landing target in MAV_FRAME"]
17149 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17150 pub y: f32,
17151 #[doc = "Z Position of the landing target in MAV_FRAME"]
17152 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17153 pub z: f32,
17154 #[doc = "Quaternion of landing target orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
17155 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17156 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17157 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
17158 pub q: [f32; 4],
17159 #[doc = "Type of landing target"]
17160 #[cfg_attr(feature = "serde", serde(default))]
17161 pub mavtype: LandingTargetType,
17162 #[doc = "Boolean indicating whether the position fields (x, y, z, q, type) contain valid target position information (valid: 1, invalid: 0). Default is 0 (invalid)."]
17163 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17164 pub position_valid: u8,
17165}
17166impl LANDING_TARGET_DATA {
17167 pub const ENCODED_LEN: usize = 60usize;
17168 pub const DEFAULT: Self = Self {
17169 time_usec: 0_u64,
17170 angle_x: 0.0_f32,
17171 angle_y: 0.0_f32,
17172 distance: 0.0_f32,
17173 size_x: 0.0_f32,
17174 size_y: 0.0_f32,
17175 target_num: 0_u8,
17176 frame: MavFrame::DEFAULT,
17177 x: 0.0_f32,
17178 y: 0.0_f32,
17179 z: 0.0_f32,
17180 q: [0.0_f32; 4usize],
17181 mavtype: LandingTargetType::DEFAULT,
17182 position_valid: 0_u8,
17183 };
17184 #[cfg(feature = "arbitrary")]
17185 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17186 use arbitrary::{Arbitrary, Unstructured};
17187 let mut buf = [0u8; 1024];
17188 rng.fill_bytes(&mut buf);
17189 let mut unstructured = Unstructured::new(&buf);
17190 Self::arbitrary(&mut unstructured).unwrap_or_default()
17191 }
17192}
17193impl Default for LANDING_TARGET_DATA {
17194 fn default() -> Self {
17195 Self::DEFAULT.clone()
17196 }
17197}
17198impl MessageData for LANDING_TARGET_DATA {
17199 type Message = MavMessage;
17200 const ID: u32 = 149u32;
17201 const NAME: &'static str = "LANDING_TARGET";
17202 const EXTRA_CRC: u8 = 200u8;
17203 const ENCODED_LEN: usize = 60usize;
17204 fn deser(
17205 _version: MavlinkVersion,
17206 __input: &[u8],
17207 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17208 let avail_len = __input.len();
17209 let mut payload_buf = [0; Self::ENCODED_LEN];
17210 let mut buf = if avail_len < Self::ENCODED_LEN {
17211 payload_buf[0..avail_len].copy_from_slice(__input);
17212 Bytes::new(&payload_buf)
17213 } else {
17214 Bytes::new(__input)
17215 };
17216 let mut __struct = Self::default();
17217 __struct.time_usec = buf.get_u64_le();
17218 __struct.angle_x = buf.get_f32_le();
17219 __struct.angle_y = buf.get_f32_le();
17220 __struct.distance = buf.get_f32_le();
17221 __struct.size_x = buf.get_f32_le();
17222 __struct.size_y = buf.get_f32_le();
17223 __struct.target_num = buf.get_u8();
17224 let tmp = buf.get_u8();
17225 __struct.frame =
17226 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17227 enum_type: "MavFrame",
17228 value: tmp as u64,
17229 })?;
17230 __struct.x = buf.get_f32_le();
17231 __struct.y = buf.get_f32_le();
17232 __struct.z = buf.get_f32_le();
17233 for v in &mut __struct.q {
17234 let val = buf.get_f32_le();
17235 *v = val;
17236 }
17237 let tmp = buf.get_u8();
17238 __struct.mavtype =
17239 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17240 enum_type: "LandingTargetType",
17241 value: tmp as u64,
17242 })?;
17243 __struct.position_valid = buf.get_u8();
17244 Ok(__struct)
17245 }
17246 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17247 let mut __tmp = BytesMut::new(bytes);
17248 #[allow(clippy::absurd_extreme_comparisons)]
17249 #[allow(unused_comparisons)]
17250 if __tmp.remaining() < Self::ENCODED_LEN {
17251 panic!(
17252 "buffer is too small (need {} bytes, but got {})",
17253 Self::ENCODED_LEN,
17254 __tmp.remaining(),
17255 )
17256 }
17257 __tmp.put_u64_le(self.time_usec);
17258 __tmp.put_f32_le(self.angle_x);
17259 __tmp.put_f32_le(self.angle_y);
17260 __tmp.put_f32_le(self.distance);
17261 __tmp.put_f32_le(self.size_x);
17262 __tmp.put_f32_le(self.size_y);
17263 __tmp.put_u8(self.target_num);
17264 __tmp.put_u8(self.frame as u8);
17265 if matches!(version, MavlinkVersion::V2) {
17266 __tmp.put_f32_le(self.x);
17267 __tmp.put_f32_le(self.y);
17268 __tmp.put_f32_le(self.z);
17269 for val in &self.q {
17270 __tmp.put_f32_le(*val);
17271 }
17272 __tmp.put_u8(self.mavtype as u8);
17273 __tmp.put_u8(self.position_valid);
17274 let len = __tmp.len();
17275 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17276 } else {
17277 __tmp.len()
17278 }
17279 }
17280}
17281#[doc = "Status generated in each node in the communication chain and injected into MAVLink stream."]
17282#[doc = ""]
17283#[doc = "ID: 8"]
17284#[derive(Debug, Clone, PartialEq)]
17285#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17286#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17287#[cfg_attr(feature = "ts", derive(TS))]
17288#[cfg_attr(feature = "ts", ts(export))]
17289pub struct LINK_NODE_STATUS_DATA {
17290 #[doc = "Timestamp (time since system boot)."]
17291 pub timestamp: u64,
17292 #[doc = "Transmit rate"]
17293 pub tx_rate: u32,
17294 #[doc = "Receive rate"]
17295 pub rx_rate: u32,
17296 #[doc = "Messages sent"]
17297 pub messages_sent: u32,
17298 #[doc = "Messages received (estimated from counting seq)"]
17299 pub messages_received: u32,
17300 #[doc = "Messages lost (estimated from counting seq)"]
17301 pub messages_lost: u32,
17302 #[doc = "Number of bytes that could not be parsed correctly."]
17303 pub rx_parse_err: u16,
17304 #[doc = "Transmit buffer overflows. This number wraps around as it reaches UINT16_MAX"]
17305 pub tx_overflows: u16,
17306 #[doc = "Receive buffer overflows. This number wraps around as it reaches UINT16_MAX"]
17307 pub rx_overflows: u16,
17308 #[doc = "Remaining free transmit buffer space"]
17309 pub tx_buf: u8,
17310 #[doc = "Remaining free receive buffer space"]
17311 pub rx_buf: u8,
17312}
17313impl LINK_NODE_STATUS_DATA {
17314 pub const ENCODED_LEN: usize = 36usize;
17315 pub const DEFAULT: Self = Self {
17316 timestamp: 0_u64,
17317 tx_rate: 0_u32,
17318 rx_rate: 0_u32,
17319 messages_sent: 0_u32,
17320 messages_received: 0_u32,
17321 messages_lost: 0_u32,
17322 rx_parse_err: 0_u16,
17323 tx_overflows: 0_u16,
17324 rx_overflows: 0_u16,
17325 tx_buf: 0_u8,
17326 rx_buf: 0_u8,
17327 };
17328 #[cfg(feature = "arbitrary")]
17329 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17330 use arbitrary::{Arbitrary, Unstructured};
17331 let mut buf = [0u8; 1024];
17332 rng.fill_bytes(&mut buf);
17333 let mut unstructured = Unstructured::new(&buf);
17334 Self::arbitrary(&mut unstructured).unwrap_or_default()
17335 }
17336}
17337impl Default for LINK_NODE_STATUS_DATA {
17338 fn default() -> Self {
17339 Self::DEFAULT.clone()
17340 }
17341}
17342impl MessageData for LINK_NODE_STATUS_DATA {
17343 type Message = MavMessage;
17344 const ID: u32 = 8u32;
17345 const NAME: &'static str = "LINK_NODE_STATUS";
17346 const EXTRA_CRC: u8 = 117u8;
17347 const ENCODED_LEN: usize = 36usize;
17348 fn deser(
17349 _version: MavlinkVersion,
17350 __input: &[u8],
17351 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17352 let avail_len = __input.len();
17353 let mut payload_buf = [0; Self::ENCODED_LEN];
17354 let mut buf = if avail_len < Self::ENCODED_LEN {
17355 payload_buf[0..avail_len].copy_from_slice(__input);
17356 Bytes::new(&payload_buf)
17357 } else {
17358 Bytes::new(__input)
17359 };
17360 let mut __struct = Self::default();
17361 __struct.timestamp = buf.get_u64_le();
17362 __struct.tx_rate = buf.get_u32_le();
17363 __struct.rx_rate = buf.get_u32_le();
17364 __struct.messages_sent = buf.get_u32_le();
17365 __struct.messages_received = buf.get_u32_le();
17366 __struct.messages_lost = buf.get_u32_le();
17367 __struct.rx_parse_err = buf.get_u16_le();
17368 __struct.tx_overflows = buf.get_u16_le();
17369 __struct.rx_overflows = buf.get_u16_le();
17370 __struct.tx_buf = buf.get_u8();
17371 __struct.rx_buf = buf.get_u8();
17372 Ok(__struct)
17373 }
17374 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17375 let mut __tmp = BytesMut::new(bytes);
17376 #[allow(clippy::absurd_extreme_comparisons)]
17377 #[allow(unused_comparisons)]
17378 if __tmp.remaining() < Self::ENCODED_LEN {
17379 panic!(
17380 "buffer is too small (need {} bytes, but got {})",
17381 Self::ENCODED_LEN,
17382 __tmp.remaining(),
17383 )
17384 }
17385 __tmp.put_u64_le(self.timestamp);
17386 __tmp.put_u32_le(self.tx_rate);
17387 __tmp.put_u32_le(self.rx_rate);
17388 __tmp.put_u32_le(self.messages_sent);
17389 __tmp.put_u32_le(self.messages_received);
17390 __tmp.put_u32_le(self.messages_lost);
17391 __tmp.put_u16_le(self.rx_parse_err);
17392 __tmp.put_u16_le(self.tx_overflows);
17393 __tmp.put_u16_le(self.rx_overflows);
17394 __tmp.put_u8(self.tx_buf);
17395 __tmp.put_u8(self.rx_buf);
17396 if matches!(version, MavlinkVersion::V2) {
17397 let len = __tmp.len();
17398 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17399 } else {
17400 __tmp.len()
17401 }
17402 }
17403}
17404#[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
17405#[doc = ""]
17406#[doc = "ID: 32"]
17407#[derive(Debug, Clone, PartialEq)]
17408#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17409#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17410#[cfg_attr(feature = "ts", derive(TS))]
17411#[cfg_attr(feature = "ts", ts(export))]
17412pub struct LOCAL_POSITION_NED_DATA {
17413 #[doc = "Timestamp (time since system boot)."]
17414 pub time_boot_ms: u32,
17415 #[doc = "X Position"]
17416 pub x: f32,
17417 #[doc = "Y Position"]
17418 pub y: f32,
17419 #[doc = "Z Position"]
17420 pub z: f32,
17421 #[doc = "X Speed"]
17422 pub vx: f32,
17423 #[doc = "Y Speed"]
17424 pub vy: f32,
17425 #[doc = "Z Speed"]
17426 pub vz: f32,
17427}
17428impl LOCAL_POSITION_NED_DATA {
17429 pub const ENCODED_LEN: usize = 28usize;
17430 pub const DEFAULT: Self = Self {
17431 time_boot_ms: 0_u32,
17432 x: 0.0_f32,
17433 y: 0.0_f32,
17434 z: 0.0_f32,
17435 vx: 0.0_f32,
17436 vy: 0.0_f32,
17437 vz: 0.0_f32,
17438 };
17439 #[cfg(feature = "arbitrary")]
17440 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17441 use arbitrary::{Arbitrary, Unstructured};
17442 let mut buf = [0u8; 1024];
17443 rng.fill_bytes(&mut buf);
17444 let mut unstructured = Unstructured::new(&buf);
17445 Self::arbitrary(&mut unstructured).unwrap_or_default()
17446 }
17447}
17448impl Default for LOCAL_POSITION_NED_DATA {
17449 fn default() -> Self {
17450 Self::DEFAULT.clone()
17451 }
17452}
17453impl MessageData for LOCAL_POSITION_NED_DATA {
17454 type Message = MavMessage;
17455 const ID: u32 = 32u32;
17456 const NAME: &'static str = "LOCAL_POSITION_NED";
17457 const EXTRA_CRC: u8 = 185u8;
17458 const ENCODED_LEN: usize = 28usize;
17459 fn deser(
17460 _version: MavlinkVersion,
17461 __input: &[u8],
17462 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17463 let avail_len = __input.len();
17464 let mut payload_buf = [0; Self::ENCODED_LEN];
17465 let mut buf = if avail_len < Self::ENCODED_LEN {
17466 payload_buf[0..avail_len].copy_from_slice(__input);
17467 Bytes::new(&payload_buf)
17468 } else {
17469 Bytes::new(__input)
17470 };
17471 let mut __struct = Self::default();
17472 __struct.time_boot_ms = buf.get_u32_le();
17473 __struct.x = buf.get_f32_le();
17474 __struct.y = buf.get_f32_le();
17475 __struct.z = buf.get_f32_le();
17476 __struct.vx = buf.get_f32_le();
17477 __struct.vy = buf.get_f32_le();
17478 __struct.vz = buf.get_f32_le();
17479 Ok(__struct)
17480 }
17481 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17482 let mut __tmp = BytesMut::new(bytes);
17483 #[allow(clippy::absurd_extreme_comparisons)]
17484 #[allow(unused_comparisons)]
17485 if __tmp.remaining() < Self::ENCODED_LEN {
17486 panic!(
17487 "buffer is too small (need {} bytes, but got {})",
17488 Self::ENCODED_LEN,
17489 __tmp.remaining(),
17490 )
17491 }
17492 __tmp.put_u32_le(self.time_boot_ms);
17493 __tmp.put_f32_le(self.x);
17494 __tmp.put_f32_le(self.y);
17495 __tmp.put_f32_le(self.z);
17496 __tmp.put_f32_le(self.vx);
17497 __tmp.put_f32_le(self.vy);
17498 __tmp.put_f32_le(self.vz);
17499 if matches!(version, MavlinkVersion::V2) {
17500 let len = __tmp.len();
17501 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17502 } else {
17503 __tmp.len()
17504 }
17505 }
17506}
17507#[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
17508#[doc = ""]
17509#[doc = "ID: 64"]
17510#[derive(Debug, Clone, PartialEq)]
17511#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17512#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17513#[cfg_attr(feature = "ts", derive(TS))]
17514#[cfg_attr(feature = "ts", ts(export))]
17515pub struct LOCAL_POSITION_NED_COV_DATA {
17516 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17517 pub time_usec: u64,
17518 #[doc = "X Position"]
17519 pub x: f32,
17520 #[doc = "Y Position"]
17521 pub y: f32,
17522 #[doc = "Z Position"]
17523 pub z: f32,
17524 #[doc = "X Speed"]
17525 pub vx: f32,
17526 #[doc = "Y Speed"]
17527 pub vy: f32,
17528 #[doc = "Z Speed"]
17529 pub vz: f32,
17530 #[doc = "X Acceleration"]
17531 pub ax: f32,
17532 #[doc = "Y Acceleration"]
17533 pub ay: f32,
17534 #[doc = "Z Acceleration"]
17535 pub az: f32,
17536 #[doc = "Row-major representation of position, velocity and acceleration 9x9 cross-covariance matrix upper right triangle (states: x, y, z, vx, vy, vz, ax, ay, az; first nine entries are the first ROW, next eight entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
17537 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17538 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
17539 pub covariance: [f32; 45],
17540 #[doc = "Class id of the estimator this estimate originated from."]
17541 pub estimator_type: MavEstimatorType,
17542}
17543impl LOCAL_POSITION_NED_COV_DATA {
17544 pub const ENCODED_LEN: usize = 225usize;
17545 pub const DEFAULT: Self = Self {
17546 time_usec: 0_u64,
17547 x: 0.0_f32,
17548 y: 0.0_f32,
17549 z: 0.0_f32,
17550 vx: 0.0_f32,
17551 vy: 0.0_f32,
17552 vz: 0.0_f32,
17553 ax: 0.0_f32,
17554 ay: 0.0_f32,
17555 az: 0.0_f32,
17556 covariance: [0.0_f32; 45usize],
17557 estimator_type: MavEstimatorType::DEFAULT,
17558 };
17559 #[cfg(feature = "arbitrary")]
17560 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17561 use arbitrary::{Arbitrary, Unstructured};
17562 let mut buf = [0u8; 1024];
17563 rng.fill_bytes(&mut buf);
17564 let mut unstructured = Unstructured::new(&buf);
17565 Self::arbitrary(&mut unstructured).unwrap_or_default()
17566 }
17567}
17568impl Default for LOCAL_POSITION_NED_COV_DATA {
17569 fn default() -> Self {
17570 Self::DEFAULT.clone()
17571 }
17572}
17573impl MessageData for LOCAL_POSITION_NED_COV_DATA {
17574 type Message = MavMessage;
17575 const ID: u32 = 64u32;
17576 const NAME: &'static str = "LOCAL_POSITION_NED_COV";
17577 const EXTRA_CRC: u8 = 191u8;
17578 const ENCODED_LEN: usize = 225usize;
17579 fn deser(
17580 _version: MavlinkVersion,
17581 __input: &[u8],
17582 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17583 let avail_len = __input.len();
17584 let mut payload_buf = [0; Self::ENCODED_LEN];
17585 let mut buf = if avail_len < Self::ENCODED_LEN {
17586 payload_buf[0..avail_len].copy_from_slice(__input);
17587 Bytes::new(&payload_buf)
17588 } else {
17589 Bytes::new(__input)
17590 };
17591 let mut __struct = Self::default();
17592 __struct.time_usec = buf.get_u64_le();
17593 __struct.x = buf.get_f32_le();
17594 __struct.y = buf.get_f32_le();
17595 __struct.z = buf.get_f32_le();
17596 __struct.vx = buf.get_f32_le();
17597 __struct.vy = buf.get_f32_le();
17598 __struct.vz = buf.get_f32_le();
17599 __struct.ax = buf.get_f32_le();
17600 __struct.ay = buf.get_f32_le();
17601 __struct.az = buf.get_f32_le();
17602 for v in &mut __struct.covariance {
17603 let val = buf.get_f32_le();
17604 *v = val;
17605 }
17606 let tmp = buf.get_u8();
17607 __struct.estimator_type =
17608 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17609 enum_type: "MavEstimatorType",
17610 value: tmp as u64,
17611 })?;
17612 Ok(__struct)
17613 }
17614 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17615 let mut __tmp = BytesMut::new(bytes);
17616 #[allow(clippy::absurd_extreme_comparisons)]
17617 #[allow(unused_comparisons)]
17618 if __tmp.remaining() < Self::ENCODED_LEN {
17619 panic!(
17620 "buffer is too small (need {} bytes, but got {})",
17621 Self::ENCODED_LEN,
17622 __tmp.remaining(),
17623 )
17624 }
17625 __tmp.put_u64_le(self.time_usec);
17626 __tmp.put_f32_le(self.x);
17627 __tmp.put_f32_le(self.y);
17628 __tmp.put_f32_le(self.z);
17629 __tmp.put_f32_le(self.vx);
17630 __tmp.put_f32_le(self.vy);
17631 __tmp.put_f32_le(self.vz);
17632 __tmp.put_f32_le(self.ax);
17633 __tmp.put_f32_le(self.ay);
17634 __tmp.put_f32_le(self.az);
17635 for val in &self.covariance {
17636 __tmp.put_f32_le(*val);
17637 }
17638 __tmp.put_u8(self.estimator_type as u8);
17639 if matches!(version, MavlinkVersion::V2) {
17640 let len = __tmp.len();
17641 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17642 } else {
17643 __tmp.len()
17644 }
17645 }
17646}
17647#[doc = "The offset in X, Y, Z and yaw between the LOCAL_POSITION_NED messages of MAV X and the global coordinate frame in NED coordinates. Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
17648#[doc = ""]
17649#[doc = "ID: 89"]
17650#[derive(Debug, Clone, PartialEq)]
17651#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17652#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17653#[cfg_attr(feature = "ts", derive(TS))]
17654#[cfg_attr(feature = "ts", ts(export))]
17655pub struct LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
17656 #[doc = "Timestamp (time since system boot)."]
17657 pub time_boot_ms: u32,
17658 #[doc = "X Position"]
17659 pub x: f32,
17660 #[doc = "Y Position"]
17661 pub y: f32,
17662 #[doc = "Z Position"]
17663 pub z: f32,
17664 #[doc = "Roll"]
17665 pub roll: f32,
17666 #[doc = "Pitch"]
17667 pub pitch: f32,
17668 #[doc = "Yaw"]
17669 pub yaw: f32,
17670}
17671impl LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
17672 pub const ENCODED_LEN: usize = 28usize;
17673 pub const DEFAULT: Self = Self {
17674 time_boot_ms: 0_u32,
17675 x: 0.0_f32,
17676 y: 0.0_f32,
17677 z: 0.0_f32,
17678 roll: 0.0_f32,
17679 pitch: 0.0_f32,
17680 yaw: 0.0_f32,
17681 };
17682 #[cfg(feature = "arbitrary")]
17683 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17684 use arbitrary::{Arbitrary, Unstructured};
17685 let mut buf = [0u8; 1024];
17686 rng.fill_bytes(&mut buf);
17687 let mut unstructured = Unstructured::new(&buf);
17688 Self::arbitrary(&mut unstructured).unwrap_or_default()
17689 }
17690}
17691impl Default for LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
17692 fn default() -> Self {
17693 Self::DEFAULT.clone()
17694 }
17695}
17696impl MessageData for LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
17697 type Message = MavMessage;
17698 const ID: u32 = 89u32;
17699 const NAME: &'static str = "LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET";
17700 const EXTRA_CRC: u8 = 231u8;
17701 const ENCODED_LEN: usize = 28usize;
17702 fn deser(
17703 _version: MavlinkVersion,
17704 __input: &[u8],
17705 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17706 let avail_len = __input.len();
17707 let mut payload_buf = [0; Self::ENCODED_LEN];
17708 let mut buf = if avail_len < Self::ENCODED_LEN {
17709 payload_buf[0..avail_len].copy_from_slice(__input);
17710 Bytes::new(&payload_buf)
17711 } else {
17712 Bytes::new(__input)
17713 };
17714 let mut __struct = Self::default();
17715 __struct.time_boot_ms = buf.get_u32_le();
17716 __struct.x = buf.get_f32_le();
17717 __struct.y = buf.get_f32_le();
17718 __struct.z = buf.get_f32_le();
17719 __struct.roll = buf.get_f32_le();
17720 __struct.pitch = buf.get_f32_le();
17721 __struct.yaw = buf.get_f32_le();
17722 Ok(__struct)
17723 }
17724 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17725 let mut __tmp = BytesMut::new(bytes);
17726 #[allow(clippy::absurd_extreme_comparisons)]
17727 #[allow(unused_comparisons)]
17728 if __tmp.remaining() < Self::ENCODED_LEN {
17729 panic!(
17730 "buffer is too small (need {} bytes, but got {})",
17731 Self::ENCODED_LEN,
17732 __tmp.remaining(),
17733 )
17734 }
17735 __tmp.put_u32_le(self.time_boot_ms);
17736 __tmp.put_f32_le(self.x);
17737 __tmp.put_f32_le(self.y);
17738 __tmp.put_f32_le(self.z);
17739 __tmp.put_f32_le(self.roll);
17740 __tmp.put_f32_le(self.pitch);
17741 __tmp.put_f32_le(self.yaw);
17742 if matches!(version, MavlinkVersion::V2) {
17743 let len = __tmp.len();
17744 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17745 } else {
17746 __tmp.len()
17747 }
17748 }
17749}
17750#[doc = "An ack for a LOGGING_DATA_ACKED message."]
17751#[doc = ""]
17752#[doc = "ID: 268"]
17753#[derive(Debug, Clone, PartialEq)]
17754#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17755#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17756#[cfg_attr(feature = "ts", derive(TS))]
17757#[cfg_attr(feature = "ts", ts(export))]
17758pub struct LOGGING_ACK_DATA {
17759 #[doc = "sequence number (must match the one in LOGGING_DATA_ACKED)"]
17760 pub sequence: u16,
17761 #[doc = "system ID of the target"]
17762 pub target_system: u8,
17763 #[doc = "component ID of the target"]
17764 pub target_component: u8,
17765}
17766impl LOGGING_ACK_DATA {
17767 pub const ENCODED_LEN: usize = 4usize;
17768 pub const DEFAULT: Self = Self {
17769 sequence: 0_u16,
17770 target_system: 0_u8,
17771 target_component: 0_u8,
17772 };
17773 #[cfg(feature = "arbitrary")]
17774 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17775 use arbitrary::{Arbitrary, Unstructured};
17776 let mut buf = [0u8; 1024];
17777 rng.fill_bytes(&mut buf);
17778 let mut unstructured = Unstructured::new(&buf);
17779 Self::arbitrary(&mut unstructured).unwrap_or_default()
17780 }
17781}
17782impl Default for LOGGING_ACK_DATA {
17783 fn default() -> Self {
17784 Self::DEFAULT.clone()
17785 }
17786}
17787impl MessageData for LOGGING_ACK_DATA {
17788 type Message = MavMessage;
17789 const ID: u32 = 268u32;
17790 const NAME: &'static str = "LOGGING_ACK";
17791 const EXTRA_CRC: u8 = 14u8;
17792 const ENCODED_LEN: usize = 4usize;
17793 fn deser(
17794 _version: MavlinkVersion,
17795 __input: &[u8],
17796 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17797 let avail_len = __input.len();
17798 let mut payload_buf = [0; Self::ENCODED_LEN];
17799 let mut buf = if avail_len < Self::ENCODED_LEN {
17800 payload_buf[0..avail_len].copy_from_slice(__input);
17801 Bytes::new(&payload_buf)
17802 } else {
17803 Bytes::new(__input)
17804 };
17805 let mut __struct = Self::default();
17806 __struct.sequence = buf.get_u16_le();
17807 __struct.target_system = buf.get_u8();
17808 __struct.target_component = buf.get_u8();
17809 Ok(__struct)
17810 }
17811 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17812 let mut __tmp = BytesMut::new(bytes);
17813 #[allow(clippy::absurd_extreme_comparisons)]
17814 #[allow(unused_comparisons)]
17815 if __tmp.remaining() < Self::ENCODED_LEN {
17816 panic!(
17817 "buffer is too small (need {} bytes, but got {})",
17818 Self::ENCODED_LEN,
17819 __tmp.remaining(),
17820 )
17821 }
17822 __tmp.put_u16_le(self.sequence);
17823 __tmp.put_u8(self.target_system);
17824 __tmp.put_u8(self.target_component);
17825 if matches!(version, MavlinkVersion::V2) {
17826 let len = __tmp.len();
17827 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17828 } else {
17829 __tmp.len()
17830 }
17831 }
17832}
17833#[doc = "A message containing logged data (see also MAV_CMD_LOGGING_START)."]
17834#[doc = ""]
17835#[doc = "ID: 266"]
17836#[derive(Debug, Clone, PartialEq)]
17837#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17838#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17839#[cfg_attr(feature = "ts", derive(TS))]
17840#[cfg_attr(feature = "ts", ts(export))]
17841pub struct LOGGING_DATA_DATA {
17842 #[doc = "sequence number (can wrap)"]
17843 pub sequence: u16,
17844 #[doc = "system ID of the target"]
17845 pub target_system: u8,
17846 #[doc = "component ID of the target"]
17847 pub target_component: u8,
17848 #[doc = "data length"]
17849 pub length: u8,
17850 #[doc = "offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to UINT8_MAX if no start exists)."]
17851 pub first_message_offset: u8,
17852 #[doc = "logged data"]
17853 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17854 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
17855 pub data: [u8; 249],
17856}
17857impl LOGGING_DATA_DATA {
17858 pub const ENCODED_LEN: usize = 255usize;
17859 pub const DEFAULT: Self = Self {
17860 sequence: 0_u16,
17861 target_system: 0_u8,
17862 target_component: 0_u8,
17863 length: 0_u8,
17864 first_message_offset: 0_u8,
17865 data: [0_u8; 249usize],
17866 };
17867 #[cfg(feature = "arbitrary")]
17868 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17869 use arbitrary::{Arbitrary, Unstructured};
17870 let mut buf = [0u8; 1024];
17871 rng.fill_bytes(&mut buf);
17872 let mut unstructured = Unstructured::new(&buf);
17873 Self::arbitrary(&mut unstructured).unwrap_or_default()
17874 }
17875}
17876impl Default for LOGGING_DATA_DATA {
17877 fn default() -> Self {
17878 Self::DEFAULT.clone()
17879 }
17880}
17881impl MessageData for LOGGING_DATA_DATA {
17882 type Message = MavMessage;
17883 const ID: u32 = 266u32;
17884 const NAME: &'static str = "LOGGING_DATA";
17885 const EXTRA_CRC: u8 = 193u8;
17886 const ENCODED_LEN: usize = 255usize;
17887 fn deser(
17888 _version: MavlinkVersion,
17889 __input: &[u8],
17890 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17891 let avail_len = __input.len();
17892 let mut payload_buf = [0; Self::ENCODED_LEN];
17893 let mut buf = if avail_len < Self::ENCODED_LEN {
17894 payload_buf[0..avail_len].copy_from_slice(__input);
17895 Bytes::new(&payload_buf)
17896 } else {
17897 Bytes::new(__input)
17898 };
17899 let mut __struct = Self::default();
17900 __struct.sequence = buf.get_u16_le();
17901 __struct.target_system = buf.get_u8();
17902 __struct.target_component = buf.get_u8();
17903 __struct.length = buf.get_u8();
17904 __struct.first_message_offset = buf.get_u8();
17905 for v in &mut __struct.data {
17906 let val = buf.get_u8();
17907 *v = val;
17908 }
17909 Ok(__struct)
17910 }
17911 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17912 let mut __tmp = BytesMut::new(bytes);
17913 #[allow(clippy::absurd_extreme_comparisons)]
17914 #[allow(unused_comparisons)]
17915 if __tmp.remaining() < Self::ENCODED_LEN {
17916 panic!(
17917 "buffer is too small (need {} bytes, but got {})",
17918 Self::ENCODED_LEN,
17919 __tmp.remaining(),
17920 )
17921 }
17922 __tmp.put_u16_le(self.sequence);
17923 __tmp.put_u8(self.target_system);
17924 __tmp.put_u8(self.target_component);
17925 __tmp.put_u8(self.length);
17926 __tmp.put_u8(self.first_message_offset);
17927 for val in &self.data {
17928 __tmp.put_u8(*val);
17929 }
17930 if matches!(version, MavlinkVersion::V2) {
17931 let len = __tmp.len();
17932 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17933 } else {
17934 __tmp.len()
17935 }
17936 }
17937}
17938#[doc = "A message containing logged data which requires a LOGGING_ACK to be sent back."]
17939#[doc = ""]
17940#[doc = "ID: 267"]
17941#[derive(Debug, Clone, PartialEq)]
17942#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17943#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17944#[cfg_attr(feature = "ts", derive(TS))]
17945#[cfg_attr(feature = "ts", ts(export))]
17946pub struct LOGGING_DATA_ACKED_DATA {
17947 #[doc = "sequence number (can wrap)"]
17948 pub sequence: u16,
17949 #[doc = "system ID of the target"]
17950 pub target_system: u8,
17951 #[doc = "component ID of the target"]
17952 pub target_component: u8,
17953 #[doc = "data length"]
17954 pub length: u8,
17955 #[doc = "offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to UINT8_MAX if no start exists)."]
17956 pub first_message_offset: u8,
17957 #[doc = "logged data"]
17958 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17959 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
17960 pub data: [u8; 249],
17961}
17962impl LOGGING_DATA_ACKED_DATA {
17963 pub const ENCODED_LEN: usize = 255usize;
17964 pub const DEFAULT: Self = Self {
17965 sequence: 0_u16,
17966 target_system: 0_u8,
17967 target_component: 0_u8,
17968 length: 0_u8,
17969 first_message_offset: 0_u8,
17970 data: [0_u8; 249usize],
17971 };
17972 #[cfg(feature = "arbitrary")]
17973 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17974 use arbitrary::{Arbitrary, Unstructured};
17975 let mut buf = [0u8; 1024];
17976 rng.fill_bytes(&mut buf);
17977 let mut unstructured = Unstructured::new(&buf);
17978 Self::arbitrary(&mut unstructured).unwrap_or_default()
17979 }
17980}
17981impl Default for LOGGING_DATA_ACKED_DATA {
17982 fn default() -> Self {
17983 Self::DEFAULT.clone()
17984 }
17985}
17986impl MessageData for LOGGING_DATA_ACKED_DATA {
17987 type Message = MavMessage;
17988 const ID: u32 = 267u32;
17989 const NAME: &'static str = "LOGGING_DATA_ACKED";
17990 const EXTRA_CRC: u8 = 35u8;
17991 const ENCODED_LEN: usize = 255usize;
17992 fn deser(
17993 _version: MavlinkVersion,
17994 __input: &[u8],
17995 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17996 let avail_len = __input.len();
17997 let mut payload_buf = [0; Self::ENCODED_LEN];
17998 let mut buf = if avail_len < Self::ENCODED_LEN {
17999 payload_buf[0..avail_len].copy_from_slice(__input);
18000 Bytes::new(&payload_buf)
18001 } else {
18002 Bytes::new(__input)
18003 };
18004 let mut __struct = Self::default();
18005 __struct.sequence = buf.get_u16_le();
18006 __struct.target_system = buf.get_u8();
18007 __struct.target_component = buf.get_u8();
18008 __struct.length = buf.get_u8();
18009 __struct.first_message_offset = buf.get_u8();
18010 for v in &mut __struct.data {
18011 let val = buf.get_u8();
18012 *v = val;
18013 }
18014 Ok(__struct)
18015 }
18016 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18017 let mut __tmp = BytesMut::new(bytes);
18018 #[allow(clippy::absurd_extreme_comparisons)]
18019 #[allow(unused_comparisons)]
18020 if __tmp.remaining() < Self::ENCODED_LEN {
18021 panic!(
18022 "buffer is too small (need {} bytes, but got {})",
18023 Self::ENCODED_LEN,
18024 __tmp.remaining(),
18025 )
18026 }
18027 __tmp.put_u16_le(self.sequence);
18028 __tmp.put_u8(self.target_system);
18029 __tmp.put_u8(self.target_component);
18030 __tmp.put_u8(self.length);
18031 __tmp.put_u8(self.first_message_offset);
18032 for val in &self.data {
18033 __tmp.put_u8(*val);
18034 }
18035 if matches!(version, MavlinkVersion::V2) {
18036 let len = __tmp.len();
18037 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18038 } else {
18039 __tmp.len()
18040 }
18041 }
18042}
18043#[doc = "Reply to LOG_REQUEST_DATA."]
18044#[doc = ""]
18045#[doc = "ID: 120"]
18046#[derive(Debug, Clone, PartialEq)]
18047#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18048#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18049#[cfg_attr(feature = "ts", derive(TS))]
18050#[cfg_attr(feature = "ts", ts(export))]
18051pub struct LOG_DATA_DATA {
18052 #[doc = "Offset into the log"]
18053 pub ofs: u32,
18054 #[doc = "Log id (from LOG_ENTRY reply)"]
18055 pub id: u16,
18056 #[doc = "Number of bytes (zero for end of log)"]
18057 pub count: u8,
18058 #[doc = "log data"]
18059 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
18060 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
18061 pub data: [u8; 90],
18062}
18063impl LOG_DATA_DATA {
18064 pub const ENCODED_LEN: usize = 97usize;
18065 pub const DEFAULT: Self = Self {
18066 ofs: 0_u32,
18067 id: 0_u16,
18068 count: 0_u8,
18069 data: [0_u8; 90usize],
18070 };
18071 #[cfg(feature = "arbitrary")]
18072 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18073 use arbitrary::{Arbitrary, Unstructured};
18074 let mut buf = [0u8; 1024];
18075 rng.fill_bytes(&mut buf);
18076 let mut unstructured = Unstructured::new(&buf);
18077 Self::arbitrary(&mut unstructured).unwrap_or_default()
18078 }
18079}
18080impl Default for LOG_DATA_DATA {
18081 fn default() -> Self {
18082 Self::DEFAULT.clone()
18083 }
18084}
18085impl MessageData for LOG_DATA_DATA {
18086 type Message = MavMessage;
18087 const ID: u32 = 120u32;
18088 const NAME: &'static str = "LOG_DATA";
18089 const EXTRA_CRC: u8 = 134u8;
18090 const ENCODED_LEN: usize = 97usize;
18091 fn deser(
18092 _version: MavlinkVersion,
18093 __input: &[u8],
18094 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18095 let avail_len = __input.len();
18096 let mut payload_buf = [0; Self::ENCODED_LEN];
18097 let mut buf = if avail_len < Self::ENCODED_LEN {
18098 payload_buf[0..avail_len].copy_from_slice(__input);
18099 Bytes::new(&payload_buf)
18100 } else {
18101 Bytes::new(__input)
18102 };
18103 let mut __struct = Self::default();
18104 __struct.ofs = buf.get_u32_le();
18105 __struct.id = buf.get_u16_le();
18106 __struct.count = buf.get_u8();
18107 for v in &mut __struct.data {
18108 let val = buf.get_u8();
18109 *v = val;
18110 }
18111 Ok(__struct)
18112 }
18113 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18114 let mut __tmp = BytesMut::new(bytes);
18115 #[allow(clippy::absurd_extreme_comparisons)]
18116 #[allow(unused_comparisons)]
18117 if __tmp.remaining() < Self::ENCODED_LEN {
18118 panic!(
18119 "buffer is too small (need {} bytes, but got {})",
18120 Self::ENCODED_LEN,
18121 __tmp.remaining(),
18122 )
18123 }
18124 __tmp.put_u32_le(self.ofs);
18125 __tmp.put_u16_le(self.id);
18126 __tmp.put_u8(self.count);
18127 for val in &self.data {
18128 __tmp.put_u8(*val);
18129 }
18130 if matches!(version, MavlinkVersion::V2) {
18131 let len = __tmp.len();
18132 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18133 } else {
18134 __tmp.len()
18135 }
18136 }
18137}
18138#[doc = "Reply to LOG_REQUEST_LIST."]
18139#[doc = ""]
18140#[doc = "ID: 118"]
18141#[derive(Debug, Clone, PartialEq)]
18142#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18143#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18144#[cfg_attr(feature = "ts", derive(TS))]
18145#[cfg_attr(feature = "ts", ts(export))]
18146pub struct LOG_ENTRY_DATA {
18147 #[doc = "UTC timestamp of log since 1970, or 0 if not available"]
18148 pub time_utc: u32,
18149 #[doc = "Size of the log (may be approximate)"]
18150 pub size: u32,
18151 #[doc = "Log id"]
18152 pub id: u16,
18153 #[doc = "Total number of logs"]
18154 pub num_logs: u16,
18155 #[doc = "High log number"]
18156 pub last_log_num: u16,
18157}
18158impl LOG_ENTRY_DATA {
18159 pub const ENCODED_LEN: usize = 14usize;
18160 pub const DEFAULT: Self = Self {
18161 time_utc: 0_u32,
18162 size: 0_u32,
18163 id: 0_u16,
18164 num_logs: 0_u16,
18165 last_log_num: 0_u16,
18166 };
18167 #[cfg(feature = "arbitrary")]
18168 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18169 use arbitrary::{Arbitrary, Unstructured};
18170 let mut buf = [0u8; 1024];
18171 rng.fill_bytes(&mut buf);
18172 let mut unstructured = Unstructured::new(&buf);
18173 Self::arbitrary(&mut unstructured).unwrap_or_default()
18174 }
18175}
18176impl Default for LOG_ENTRY_DATA {
18177 fn default() -> Self {
18178 Self::DEFAULT.clone()
18179 }
18180}
18181impl MessageData for LOG_ENTRY_DATA {
18182 type Message = MavMessage;
18183 const ID: u32 = 118u32;
18184 const NAME: &'static str = "LOG_ENTRY";
18185 const EXTRA_CRC: u8 = 56u8;
18186 const ENCODED_LEN: usize = 14usize;
18187 fn deser(
18188 _version: MavlinkVersion,
18189 __input: &[u8],
18190 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18191 let avail_len = __input.len();
18192 let mut payload_buf = [0; Self::ENCODED_LEN];
18193 let mut buf = if avail_len < Self::ENCODED_LEN {
18194 payload_buf[0..avail_len].copy_from_slice(__input);
18195 Bytes::new(&payload_buf)
18196 } else {
18197 Bytes::new(__input)
18198 };
18199 let mut __struct = Self::default();
18200 __struct.time_utc = buf.get_u32_le();
18201 __struct.size = buf.get_u32_le();
18202 __struct.id = buf.get_u16_le();
18203 __struct.num_logs = buf.get_u16_le();
18204 __struct.last_log_num = buf.get_u16_le();
18205 Ok(__struct)
18206 }
18207 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18208 let mut __tmp = BytesMut::new(bytes);
18209 #[allow(clippy::absurd_extreme_comparisons)]
18210 #[allow(unused_comparisons)]
18211 if __tmp.remaining() < Self::ENCODED_LEN {
18212 panic!(
18213 "buffer is too small (need {} bytes, but got {})",
18214 Self::ENCODED_LEN,
18215 __tmp.remaining(),
18216 )
18217 }
18218 __tmp.put_u32_le(self.time_utc);
18219 __tmp.put_u32_le(self.size);
18220 __tmp.put_u16_le(self.id);
18221 __tmp.put_u16_le(self.num_logs);
18222 __tmp.put_u16_le(self.last_log_num);
18223 if matches!(version, MavlinkVersion::V2) {
18224 let len = __tmp.len();
18225 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18226 } else {
18227 __tmp.len()
18228 }
18229 }
18230}
18231#[doc = "Erase all logs."]
18232#[doc = ""]
18233#[doc = "ID: 121"]
18234#[derive(Debug, Clone, PartialEq)]
18235#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18236#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18237#[cfg_attr(feature = "ts", derive(TS))]
18238#[cfg_attr(feature = "ts", ts(export))]
18239pub struct LOG_ERASE_DATA {
18240 #[doc = "System ID"]
18241 pub target_system: u8,
18242 #[doc = "Component ID"]
18243 pub target_component: u8,
18244}
18245impl LOG_ERASE_DATA {
18246 pub const ENCODED_LEN: usize = 2usize;
18247 pub const DEFAULT: Self = Self {
18248 target_system: 0_u8,
18249 target_component: 0_u8,
18250 };
18251 #[cfg(feature = "arbitrary")]
18252 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18253 use arbitrary::{Arbitrary, Unstructured};
18254 let mut buf = [0u8; 1024];
18255 rng.fill_bytes(&mut buf);
18256 let mut unstructured = Unstructured::new(&buf);
18257 Self::arbitrary(&mut unstructured).unwrap_or_default()
18258 }
18259}
18260impl Default for LOG_ERASE_DATA {
18261 fn default() -> Self {
18262 Self::DEFAULT.clone()
18263 }
18264}
18265impl MessageData for LOG_ERASE_DATA {
18266 type Message = MavMessage;
18267 const ID: u32 = 121u32;
18268 const NAME: &'static str = "LOG_ERASE";
18269 const EXTRA_CRC: u8 = 237u8;
18270 const ENCODED_LEN: usize = 2usize;
18271 fn deser(
18272 _version: MavlinkVersion,
18273 __input: &[u8],
18274 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18275 let avail_len = __input.len();
18276 let mut payload_buf = [0; Self::ENCODED_LEN];
18277 let mut buf = if avail_len < Self::ENCODED_LEN {
18278 payload_buf[0..avail_len].copy_from_slice(__input);
18279 Bytes::new(&payload_buf)
18280 } else {
18281 Bytes::new(__input)
18282 };
18283 let mut __struct = Self::default();
18284 __struct.target_system = buf.get_u8();
18285 __struct.target_component = buf.get_u8();
18286 Ok(__struct)
18287 }
18288 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18289 let mut __tmp = BytesMut::new(bytes);
18290 #[allow(clippy::absurd_extreme_comparisons)]
18291 #[allow(unused_comparisons)]
18292 if __tmp.remaining() < Self::ENCODED_LEN {
18293 panic!(
18294 "buffer is too small (need {} bytes, but got {})",
18295 Self::ENCODED_LEN,
18296 __tmp.remaining(),
18297 )
18298 }
18299 __tmp.put_u8(self.target_system);
18300 __tmp.put_u8(self.target_component);
18301 if matches!(version, MavlinkVersion::V2) {
18302 let len = __tmp.len();
18303 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18304 } else {
18305 __tmp.len()
18306 }
18307 }
18308}
18309#[doc = "Request a chunk of a log."]
18310#[doc = ""]
18311#[doc = "ID: 119"]
18312#[derive(Debug, Clone, PartialEq)]
18313#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18314#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18315#[cfg_attr(feature = "ts", derive(TS))]
18316#[cfg_attr(feature = "ts", ts(export))]
18317pub struct LOG_REQUEST_DATA_DATA {
18318 #[doc = "Offset into the log"]
18319 pub ofs: u32,
18320 #[doc = "Number of bytes"]
18321 pub count: u32,
18322 #[doc = "Log id (from LOG_ENTRY reply)"]
18323 pub id: u16,
18324 #[doc = "System ID"]
18325 pub target_system: u8,
18326 #[doc = "Component ID"]
18327 pub target_component: u8,
18328}
18329impl LOG_REQUEST_DATA_DATA {
18330 pub const ENCODED_LEN: usize = 12usize;
18331 pub const DEFAULT: Self = Self {
18332 ofs: 0_u32,
18333 count: 0_u32,
18334 id: 0_u16,
18335 target_system: 0_u8,
18336 target_component: 0_u8,
18337 };
18338 #[cfg(feature = "arbitrary")]
18339 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18340 use arbitrary::{Arbitrary, Unstructured};
18341 let mut buf = [0u8; 1024];
18342 rng.fill_bytes(&mut buf);
18343 let mut unstructured = Unstructured::new(&buf);
18344 Self::arbitrary(&mut unstructured).unwrap_or_default()
18345 }
18346}
18347impl Default for LOG_REQUEST_DATA_DATA {
18348 fn default() -> Self {
18349 Self::DEFAULT.clone()
18350 }
18351}
18352impl MessageData for LOG_REQUEST_DATA_DATA {
18353 type Message = MavMessage;
18354 const ID: u32 = 119u32;
18355 const NAME: &'static str = "LOG_REQUEST_DATA";
18356 const EXTRA_CRC: u8 = 116u8;
18357 const ENCODED_LEN: usize = 12usize;
18358 fn deser(
18359 _version: MavlinkVersion,
18360 __input: &[u8],
18361 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18362 let avail_len = __input.len();
18363 let mut payload_buf = [0; Self::ENCODED_LEN];
18364 let mut buf = if avail_len < Self::ENCODED_LEN {
18365 payload_buf[0..avail_len].copy_from_slice(__input);
18366 Bytes::new(&payload_buf)
18367 } else {
18368 Bytes::new(__input)
18369 };
18370 let mut __struct = Self::default();
18371 __struct.ofs = buf.get_u32_le();
18372 __struct.count = buf.get_u32_le();
18373 __struct.id = buf.get_u16_le();
18374 __struct.target_system = buf.get_u8();
18375 __struct.target_component = buf.get_u8();
18376 Ok(__struct)
18377 }
18378 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18379 let mut __tmp = BytesMut::new(bytes);
18380 #[allow(clippy::absurd_extreme_comparisons)]
18381 #[allow(unused_comparisons)]
18382 if __tmp.remaining() < Self::ENCODED_LEN {
18383 panic!(
18384 "buffer is too small (need {} bytes, but got {})",
18385 Self::ENCODED_LEN,
18386 __tmp.remaining(),
18387 )
18388 }
18389 __tmp.put_u32_le(self.ofs);
18390 __tmp.put_u32_le(self.count);
18391 __tmp.put_u16_le(self.id);
18392 __tmp.put_u8(self.target_system);
18393 __tmp.put_u8(self.target_component);
18394 if matches!(version, MavlinkVersion::V2) {
18395 let len = __tmp.len();
18396 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18397 } else {
18398 __tmp.len()
18399 }
18400 }
18401}
18402#[doc = "Stop log transfer and resume normal logging."]
18403#[doc = ""]
18404#[doc = "ID: 122"]
18405#[derive(Debug, Clone, PartialEq)]
18406#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18407#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18408#[cfg_attr(feature = "ts", derive(TS))]
18409#[cfg_attr(feature = "ts", ts(export))]
18410pub struct LOG_REQUEST_END_DATA {
18411 #[doc = "System ID"]
18412 pub target_system: u8,
18413 #[doc = "Component ID"]
18414 pub target_component: u8,
18415}
18416impl LOG_REQUEST_END_DATA {
18417 pub const ENCODED_LEN: usize = 2usize;
18418 pub const DEFAULT: Self = Self {
18419 target_system: 0_u8,
18420 target_component: 0_u8,
18421 };
18422 #[cfg(feature = "arbitrary")]
18423 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18424 use arbitrary::{Arbitrary, Unstructured};
18425 let mut buf = [0u8; 1024];
18426 rng.fill_bytes(&mut buf);
18427 let mut unstructured = Unstructured::new(&buf);
18428 Self::arbitrary(&mut unstructured).unwrap_or_default()
18429 }
18430}
18431impl Default for LOG_REQUEST_END_DATA {
18432 fn default() -> Self {
18433 Self::DEFAULT.clone()
18434 }
18435}
18436impl MessageData for LOG_REQUEST_END_DATA {
18437 type Message = MavMessage;
18438 const ID: u32 = 122u32;
18439 const NAME: &'static str = "LOG_REQUEST_END";
18440 const EXTRA_CRC: u8 = 203u8;
18441 const ENCODED_LEN: usize = 2usize;
18442 fn deser(
18443 _version: MavlinkVersion,
18444 __input: &[u8],
18445 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18446 let avail_len = __input.len();
18447 let mut payload_buf = [0; Self::ENCODED_LEN];
18448 let mut buf = if avail_len < Self::ENCODED_LEN {
18449 payload_buf[0..avail_len].copy_from_slice(__input);
18450 Bytes::new(&payload_buf)
18451 } else {
18452 Bytes::new(__input)
18453 };
18454 let mut __struct = Self::default();
18455 __struct.target_system = buf.get_u8();
18456 __struct.target_component = buf.get_u8();
18457 Ok(__struct)
18458 }
18459 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18460 let mut __tmp = BytesMut::new(bytes);
18461 #[allow(clippy::absurd_extreme_comparisons)]
18462 #[allow(unused_comparisons)]
18463 if __tmp.remaining() < Self::ENCODED_LEN {
18464 panic!(
18465 "buffer is too small (need {} bytes, but got {})",
18466 Self::ENCODED_LEN,
18467 __tmp.remaining(),
18468 )
18469 }
18470 __tmp.put_u8(self.target_system);
18471 __tmp.put_u8(self.target_component);
18472 if matches!(version, MavlinkVersion::V2) {
18473 let len = __tmp.len();
18474 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18475 } else {
18476 __tmp.len()
18477 }
18478 }
18479}
18480#[doc = "Request a list of available logs. On some systems calling this may stop on-board logging until LOG_REQUEST_END is called. If there are no log files available this request shall be answered with one LOG_ENTRY message with id = 0 and num_logs = 0."]
18481#[doc = ""]
18482#[doc = "ID: 117"]
18483#[derive(Debug, Clone, PartialEq)]
18484#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18485#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18486#[cfg_attr(feature = "ts", derive(TS))]
18487#[cfg_attr(feature = "ts", ts(export))]
18488pub struct LOG_REQUEST_LIST_DATA {
18489 #[doc = "First log id (0 for first available)"]
18490 pub start: u16,
18491 #[doc = "Last log id (0xffff for last available)"]
18492 pub end: u16,
18493 #[doc = "System ID"]
18494 pub target_system: u8,
18495 #[doc = "Component ID"]
18496 pub target_component: u8,
18497}
18498impl LOG_REQUEST_LIST_DATA {
18499 pub const ENCODED_LEN: usize = 6usize;
18500 pub const DEFAULT: Self = Self {
18501 start: 0_u16,
18502 end: 0_u16,
18503 target_system: 0_u8,
18504 target_component: 0_u8,
18505 };
18506 #[cfg(feature = "arbitrary")]
18507 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18508 use arbitrary::{Arbitrary, Unstructured};
18509 let mut buf = [0u8; 1024];
18510 rng.fill_bytes(&mut buf);
18511 let mut unstructured = Unstructured::new(&buf);
18512 Self::arbitrary(&mut unstructured).unwrap_or_default()
18513 }
18514}
18515impl Default for LOG_REQUEST_LIST_DATA {
18516 fn default() -> Self {
18517 Self::DEFAULT.clone()
18518 }
18519}
18520impl MessageData for LOG_REQUEST_LIST_DATA {
18521 type Message = MavMessage;
18522 const ID: u32 = 117u32;
18523 const NAME: &'static str = "LOG_REQUEST_LIST";
18524 const EXTRA_CRC: u8 = 128u8;
18525 const ENCODED_LEN: usize = 6usize;
18526 fn deser(
18527 _version: MavlinkVersion,
18528 __input: &[u8],
18529 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18530 let avail_len = __input.len();
18531 let mut payload_buf = [0; Self::ENCODED_LEN];
18532 let mut buf = if avail_len < Self::ENCODED_LEN {
18533 payload_buf[0..avail_len].copy_from_slice(__input);
18534 Bytes::new(&payload_buf)
18535 } else {
18536 Bytes::new(__input)
18537 };
18538 let mut __struct = Self::default();
18539 __struct.start = buf.get_u16_le();
18540 __struct.end = buf.get_u16_le();
18541 __struct.target_system = buf.get_u8();
18542 __struct.target_component = buf.get_u8();
18543 Ok(__struct)
18544 }
18545 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18546 let mut __tmp = BytesMut::new(bytes);
18547 #[allow(clippy::absurd_extreme_comparisons)]
18548 #[allow(unused_comparisons)]
18549 if __tmp.remaining() < Self::ENCODED_LEN {
18550 panic!(
18551 "buffer is too small (need {} bytes, but got {})",
18552 Self::ENCODED_LEN,
18553 __tmp.remaining(),
18554 )
18555 }
18556 __tmp.put_u16_le(self.start);
18557 __tmp.put_u16_le(self.end);
18558 __tmp.put_u8(self.target_system);
18559 __tmp.put_u8(self.target_component);
18560 if matches!(version, MavlinkVersion::V2) {
18561 let len = __tmp.len();
18562 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18563 } else {
18564 __tmp.len()
18565 }
18566 }
18567}
18568#[doc = "Reports results of completed compass calibration. Sent until MAG_CAL_ACK received."]
18569#[doc = ""]
18570#[doc = "ID: 192"]
18571#[derive(Debug, Clone, PartialEq)]
18572#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18573#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18574#[cfg_attr(feature = "ts", derive(TS))]
18575#[cfg_attr(feature = "ts", ts(export))]
18576pub struct MAG_CAL_REPORT_DATA {
18577 #[doc = "RMS milligauss residuals."]
18578 pub fitness: f32,
18579 #[doc = "X offset."]
18580 pub ofs_x: f32,
18581 #[doc = "Y offset."]
18582 pub ofs_y: f32,
18583 #[doc = "Z offset."]
18584 pub ofs_z: f32,
18585 #[doc = "X diagonal (matrix 11)."]
18586 pub diag_x: f32,
18587 #[doc = "Y diagonal (matrix 22)."]
18588 pub diag_y: f32,
18589 #[doc = "Z diagonal (matrix 33)."]
18590 pub diag_z: f32,
18591 #[doc = "X off-diagonal (matrix 12 and 21)."]
18592 pub offdiag_x: f32,
18593 #[doc = "Y off-diagonal (matrix 13 and 31)."]
18594 pub offdiag_y: f32,
18595 #[doc = "Z off-diagonal (matrix 32 and 23)."]
18596 pub offdiag_z: f32,
18597 #[doc = "Compass being calibrated."]
18598 pub compass_id: u8,
18599 #[doc = "Bitmask of compasses being calibrated."]
18600 pub cal_mask: u8,
18601 #[doc = "Calibration Status."]
18602 pub cal_status: MagCalStatus,
18603 #[doc = "0=requires a MAV_CMD_DO_ACCEPT_MAG_CAL, 1=saved to parameters."]
18604 pub autosaved: u8,
18605 #[doc = "Confidence in orientation (higher is better)."]
18606 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18607 pub orientation_confidence: f32,
18608 #[doc = "orientation before calibration."]
18609 #[cfg_attr(feature = "serde", serde(default))]
18610 pub old_orientation: MavSensorOrientation,
18611 #[doc = "orientation after calibration."]
18612 #[cfg_attr(feature = "serde", serde(default))]
18613 pub new_orientation: MavSensorOrientation,
18614 #[doc = "field radius correction factor"]
18615 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18616 pub scale_factor: f32,
18617}
18618impl MAG_CAL_REPORT_DATA {
18619 pub const ENCODED_LEN: usize = 54usize;
18620 pub const DEFAULT: Self = Self {
18621 fitness: 0.0_f32,
18622 ofs_x: 0.0_f32,
18623 ofs_y: 0.0_f32,
18624 ofs_z: 0.0_f32,
18625 diag_x: 0.0_f32,
18626 diag_y: 0.0_f32,
18627 diag_z: 0.0_f32,
18628 offdiag_x: 0.0_f32,
18629 offdiag_y: 0.0_f32,
18630 offdiag_z: 0.0_f32,
18631 compass_id: 0_u8,
18632 cal_mask: 0_u8,
18633 cal_status: MagCalStatus::DEFAULT,
18634 autosaved: 0_u8,
18635 orientation_confidence: 0.0_f32,
18636 old_orientation: MavSensorOrientation::DEFAULT,
18637 new_orientation: MavSensorOrientation::DEFAULT,
18638 scale_factor: 0.0_f32,
18639 };
18640 #[cfg(feature = "arbitrary")]
18641 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18642 use arbitrary::{Arbitrary, Unstructured};
18643 let mut buf = [0u8; 1024];
18644 rng.fill_bytes(&mut buf);
18645 let mut unstructured = Unstructured::new(&buf);
18646 Self::arbitrary(&mut unstructured).unwrap_or_default()
18647 }
18648}
18649impl Default for MAG_CAL_REPORT_DATA {
18650 fn default() -> Self {
18651 Self::DEFAULT.clone()
18652 }
18653}
18654impl MessageData for MAG_CAL_REPORT_DATA {
18655 type Message = MavMessage;
18656 const ID: u32 = 192u32;
18657 const NAME: &'static str = "MAG_CAL_REPORT";
18658 const EXTRA_CRC: u8 = 36u8;
18659 const ENCODED_LEN: usize = 54usize;
18660 fn deser(
18661 _version: MavlinkVersion,
18662 __input: &[u8],
18663 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18664 let avail_len = __input.len();
18665 let mut payload_buf = [0; Self::ENCODED_LEN];
18666 let mut buf = if avail_len < Self::ENCODED_LEN {
18667 payload_buf[0..avail_len].copy_from_slice(__input);
18668 Bytes::new(&payload_buf)
18669 } else {
18670 Bytes::new(__input)
18671 };
18672 let mut __struct = Self::default();
18673 __struct.fitness = buf.get_f32_le();
18674 __struct.ofs_x = buf.get_f32_le();
18675 __struct.ofs_y = buf.get_f32_le();
18676 __struct.ofs_z = buf.get_f32_le();
18677 __struct.diag_x = buf.get_f32_le();
18678 __struct.diag_y = buf.get_f32_le();
18679 __struct.diag_z = buf.get_f32_le();
18680 __struct.offdiag_x = buf.get_f32_le();
18681 __struct.offdiag_y = buf.get_f32_le();
18682 __struct.offdiag_z = buf.get_f32_le();
18683 __struct.compass_id = buf.get_u8();
18684 __struct.cal_mask = buf.get_u8();
18685 let tmp = buf.get_u8();
18686 __struct.cal_status =
18687 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18688 enum_type: "MagCalStatus",
18689 value: tmp as u64,
18690 })?;
18691 __struct.autosaved = buf.get_u8();
18692 __struct.orientation_confidence = buf.get_f32_le();
18693 let tmp = buf.get_u8();
18694 __struct.old_orientation =
18695 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18696 enum_type: "MavSensorOrientation",
18697 value: tmp as u64,
18698 })?;
18699 let tmp = buf.get_u8();
18700 __struct.new_orientation =
18701 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18702 enum_type: "MavSensorOrientation",
18703 value: tmp as u64,
18704 })?;
18705 __struct.scale_factor = buf.get_f32_le();
18706 Ok(__struct)
18707 }
18708 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18709 let mut __tmp = BytesMut::new(bytes);
18710 #[allow(clippy::absurd_extreme_comparisons)]
18711 #[allow(unused_comparisons)]
18712 if __tmp.remaining() < Self::ENCODED_LEN {
18713 panic!(
18714 "buffer is too small (need {} bytes, but got {})",
18715 Self::ENCODED_LEN,
18716 __tmp.remaining(),
18717 )
18718 }
18719 __tmp.put_f32_le(self.fitness);
18720 __tmp.put_f32_le(self.ofs_x);
18721 __tmp.put_f32_le(self.ofs_y);
18722 __tmp.put_f32_le(self.ofs_z);
18723 __tmp.put_f32_le(self.diag_x);
18724 __tmp.put_f32_le(self.diag_y);
18725 __tmp.put_f32_le(self.diag_z);
18726 __tmp.put_f32_le(self.offdiag_x);
18727 __tmp.put_f32_le(self.offdiag_y);
18728 __tmp.put_f32_le(self.offdiag_z);
18729 __tmp.put_u8(self.compass_id);
18730 __tmp.put_u8(self.cal_mask);
18731 __tmp.put_u8(self.cal_status as u8);
18732 __tmp.put_u8(self.autosaved);
18733 if matches!(version, MavlinkVersion::V2) {
18734 __tmp.put_f32_le(self.orientation_confidence);
18735 __tmp.put_u8(self.old_orientation as u8);
18736 __tmp.put_u8(self.new_orientation as u8);
18737 __tmp.put_f32_le(self.scale_factor);
18738 let len = __tmp.len();
18739 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18740 } else {
18741 __tmp.len()
18742 }
18743 }
18744}
18745#[doc = "This message provides an API for manually controlling the vehicle using standard joystick axes nomenclature, along with a joystick-like input device. Unused axes can be disabled and buttons states are transmitted as individual on/off bits of a bitmask."]
18746#[doc = ""]
18747#[doc = "ID: 69"]
18748#[derive(Debug, Clone, PartialEq)]
18749#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18750#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18751#[cfg_attr(feature = "ts", derive(TS))]
18752#[cfg_attr(feature = "ts", ts(export))]
18753pub struct MANUAL_CONTROL_DATA {
18754 #[doc = "X-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to forward(1000)-backward(-1000) movement on a joystick and the pitch of a vehicle."]
18755 pub x: i16,
18756 #[doc = "Y-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to left(-1000)-right(1000) movement on a joystick and the roll of a vehicle."]
18757 pub y: i16,
18758 #[doc = "Z-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a separate slider movement with maximum being 1000 and minimum being -1000 on a joystick and the thrust of a vehicle. Positive values are positive thrust, negative values are negative thrust."]
18759 pub z: i16,
18760 #[doc = "R-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a twisting of the joystick, with counter-clockwise being 1000 and clockwise being -1000, and the yaw of a vehicle."]
18761 pub r: i16,
18762 #[doc = "A bitfield corresponding to the joystick buttons' 0-15 current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 1."]
18763 pub buttons: u16,
18764 #[doc = "The system to be controlled."]
18765 pub target: u8,
18766 #[doc = "A bitfield corresponding to the joystick buttons' 16-31 current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 16."]
18767 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18768 pub buttons2: u16,
18769 #[doc = "Set bits to 1 to indicate which of the following extension fields contain valid data: bit 0: pitch, bit 1: roll, bit 2: aux1, bit 3: aux2, bit 4: aux3, bit 5: aux4, bit 6: aux5, bit 7: aux6"]
18770 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18771 pub enabled_extensions: u8,
18772 #[doc = "Pitch-only-axis, normalized to the range [-1000,1000]. Generally corresponds to pitch on vehicles with additional degrees of freedom. Valid if bit 0 of enabled_extensions field is set. Set to 0 if invalid."]
18773 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18774 pub s: i16,
18775 #[doc = "Roll-only-axis, normalized to the range [-1000,1000]. Generally corresponds to roll on vehicles with additional degrees of freedom. Valid if bit 1 of enabled_extensions field is set. Set to 0 if invalid."]
18776 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18777 pub t: i16,
18778 #[doc = "Aux continuous input field 1. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 2 of enabled_extensions field is set. 0 if bit 2 is unset."]
18779 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18780 pub aux1: i16,
18781 #[doc = "Aux continuous input field 2. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 3 of enabled_extensions field is set. 0 if bit 3 is unset."]
18782 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18783 pub aux2: i16,
18784 #[doc = "Aux continuous input field 3. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 4 of enabled_extensions field is set. 0 if bit 4 is unset."]
18785 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18786 pub aux3: i16,
18787 #[doc = "Aux continuous input field 4. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 5 of enabled_extensions field is set. 0 if bit 5 is unset."]
18788 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18789 pub aux4: i16,
18790 #[doc = "Aux continuous input field 5. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 6 of enabled_extensions field is set. 0 if bit 6 is unset."]
18791 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18792 pub aux5: i16,
18793 #[doc = "Aux continuous input field 6. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 7 of enabled_extensions field is set. 0 if bit 7 is unset."]
18794 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18795 pub aux6: i16,
18796}
18797impl MANUAL_CONTROL_DATA {
18798 pub const ENCODED_LEN: usize = 30usize;
18799 pub const DEFAULT: Self = Self {
18800 x: 0_i16,
18801 y: 0_i16,
18802 z: 0_i16,
18803 r: 0_i16,
18804 buttons: 0_u16,
18805 target: 0_u8,
18806 buttons2: 0_u16,
18807 enabled_extensions: 0_u8,
18808 s: 0_i16,
18809 t: 0_i16,
18810 aux1: 0_i16,
18811 aux2: 0_i16,
18812 aux3: 0_i16,
18813 aux4: 0_i16,
18814 aux5: 0_i16,
18815 aux6: 0_i16,
18816 };
18817 #[cfg(feature = "arbitrary")]
18818 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18819 use arbitrary::{Arbitrary, Unstructured};
18820 let mut buf = [0u8; 1024];
18821 rng.fill_bytes(&mut buf);
18822 let mut unstructured = Unstructured::new(&buf);
18823 Self::arbitrary(&mut unstructured).unwrap_or_default()
18824 }
18825}
18826impl Default for MANUAL_CONTROL_DATA {
18827 fn default() -> Self {
18828 Self::DEFAULT.clone()
18829 }
18830}
18831impl MessageData for MANUAL_CONTROL_DATA {
18832 type Message = MavMessage;
18833 const ID: u32 = 69u32;
18834 const NAME: &'static str = "MANUAL_CONTROL";
18835 const EXTRA_CRC: u8 = 243u8;
18836 const ENCODED_LEN: usize = 30usize;
18837 fn deser(
18838 _version: MavlinkVersion,
18839 __input: &[u8],
18840 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18841 let avail_len = __input.len();
18842 let mut payload_buf = [0; Self::ENCODED_LEN];
18843 let mut buf = if avail_len < Self::ENCODED_LEN {
18844 payload_buf[0..avail_len].copy_from_slice(__input);
18845 Bytes::new(&payload_buf)
18846 } else {
18847 Bytes::new(__input)
18848 };
18849 let mut __struct = Self::default();
18850 __struct.x = buf.get_i16_le();
18851 __struct.y = buf.get_i16_le();
18852 __struct.z = buf.get_i16_le();
18853 __struct.r = buf.get_i16_le();
18854 __struct.buttons = buf.get_u16_le();
18855 __struct.target = buf.get_u8();
18856 __struct.buttons2 = buf.get_u16_le();
18857 __struct.enabled_extensions = buf.get_u8();
18858 __struct.s = buf.get_i16_le();
18859 __struct.t = buf.get_i16_le();
18860 __struct.aux1 = buf.get_i16_le();
18861 __struct.aux2 = buf.get_i16_le();
18862 __struct.aux3 = buf.get_i16_le();
18863 __struct.aux4 = buf.get_i16_le();
18864 __struct.aux5 = buf.get_i16_le();
18865 __struct.aux6 = buf.get_i16_le();
18866 Ok(__struct)
18867 }
18868 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18869 let mut __tmp = BytesMut::new(bytes);
18870 #[allow(clippy::absurd_extreme_comparisons)]
18871 #[allow(unused_comparisons)]
18872 if __tmp.remaining() < Self::ENCODED_LEN {
18873 panic!(
18874 "buffer is too small (need {} bytes, but got {})",
18875 Self::ENCODED_LEN,
18876 __tmp.remaining(),
18877 )
18878 }
18879 __tmp.put_i16_le(self.x);
18880 __tmp.put_i16_le(self.y);
18881 __tmp.put_i16_le(self.z);
18882 __tmp.put_i16_le(self.r);
18883 __tmp.put_u16_le(self.buttons);
18884 __tmp.put_u8(self.target);
18885 if matches!(version, MavlinkVersion::V2) {
18886 __tmp.put_u16_le(self.buttons2);
18887 __tmp.put_u8(self.enabled_extensions);
18888 __tmp.put_i16_le(self.s);
18889 __tmp.put_i16_le(self.t);
18890 __tmp.put_i16_le(self.aux1);
18891 __tmp.put_i16_le(self.aux2);
18892 __tmp.put_i16_le(self.aux3);
18893 __tmp.put_i16_le(self.aux4);
18894 __tmp.put_i16_le(self.aux5);
18895 __tmp.put_i16_le(self.aux6);
18896 let len = __tmp.len();
18897 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18898 } else {
18899 __tmp.len()
18900 }
18901 }
18902}
18903#[doc = "Setpoint in roll, pitch, yaw and thrust from the operator."]
18904#[doc = ""]
18905#[doc = "ID: 81"]
18906#[derive(Debug, Clone, PartialEq)]
18907#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18908#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18909#[cfg_attr(feature = "ts", derive(TS))]
18910#[cfg_attr(feature = "ts", ts(export))]
18911pub struct MANUAL_SETPOINT_DATA {
18912 #[doc = "Timestamp (time since system boot)."]
18913 pub time_boot_ms: u32,
18914 #[doc = "Desired roll rate"]
18915 pub roll: f32,
18916 #[doc = "Desired pitch rate"]
18917 pub pitch: f32,
18918 #[doc = "Desired yaw rate"]
18919 pub yaw: f32,
18920 #[doc = "Collective thrust, normalized to 0 .. 1"]
18921 pub thrust: f32,
18922 #[doc = "Flight mode switch position, 0.. 255"]
18923 pub mode_switch: u8,
18924 #[doc = "Override mode switch position, 0.. 255"]
18925 pub manual_override_switch: u8,
18926}
18927impl MANUAL_SETPOINT_DATA {
18928 pub const ENCODED_LEN: usize = 22usize;
18929 pub const DEFAULT: Self = Self {
18930 time_boot_ms: 0_u32,
18931 roll: 0.0_f32,
18932 pitch: 0.0_f32,
18933 yaw: 0.0_f32,
18934 thrust: 0.0_f32,
18935 mode_switch: 0_u8,
18936 manual_override_switch: 0_u8,
18937 };
18938 #[cfg(feature = "arbitrary")]
18939 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18940 use arbitrary::{Arbitrary, Unstructured};
18941 let mut buf = [0u8; 1024];
18942 rng.fill_bytes(&mut buf);
18943 let mut unstructured = Unstructured::new(&buf);
18944 Self::arbitrary(&mut unstructured).unwrap_or_default()
18945 }
18946}
18947impl Default for MANUAL_SETPOINT_DATA {
18948 fn default() -> Self {
18949 Self::DEFAULT.clone()
18950 }
18951}
18952impl MessageData for MANUAL_SETPOINT_DATA {
18953 type Message = MavMessage;
18954 const ID: u32 = 81u32;
18955 const NAME: &'static str = "MANUAL_SETPOINT";
18956 const EXTRA_CRC: u8 = 106u8;
18957 const ENCODED_LEN: usize = 22usize;
18958 fn deser(
18959 _version: MavlinkVersion,
18960 __input: &[u8],
18961 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18962 let avail_len = __input.len();
18963 let mut payload_buf = [0; Self::ENCODED_LEN];
18964 let mut buf = if avail_len < Self::ENCODED_LEN {
18965 payload_buf[0..avail_len].copy_from_slice(__input);
18966 Bytes::new(&payload_buf)
18967 } else {
18968 Bytes::new(__input)
18969 };
18970 let mut __struct = Self::default();
18971 __struct.time_boot_ms = buf.get_u32_le();
18972 __struct.roll = buf.get_f32_le();
18973 __struct.pitch = buf.get_f32_le();
18974 __struct.yaw = buf.get_f32_le();
18975 __struct.thrust = buf.get_f32_le();
18976 __struct.mode_switch = buf.get_u8();
18977 __struct.manual_override_switch = buf.get_u8();
18978 Ok(__struct)
18979 }
18980 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18981 let mut __tmp = BytesMut::new(bytes);
18982 #[allow(clippy::absurd_extreme_comparisons)]
18983 #[allow(unused_comparisons)]
18984 if __tmp.remaining() < Self::ENCODED_LEN {
18985 panic!(
18986 "buffer is too small (need {} bytes, but got {})",
18987 Self::ENCODED_LEN,
18988 __tmp.remaining(),
18989 )
18990 }
18991 __tmp.put_u32_le(self.time_boot_ms);
18992 __tmp.put_f32_le(self.roll);
18993 __tmp.put_f32_le(self.pitch);
18994 __tmp.put_f32_le(self.yaw);
18995 __tmp.put_f32_le(self.thrust);
18996 __tmp.put_u8(self.mode_switch);
18997 __tmp.put_u8(self.manual_override_switch);
18998 if matches!(version, MavlinkVersion::V2) {
18999 let len = __tmp.len();
19000 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19001 } else {
19002 __tmp.len()
19003 }
19004 }
19005}
19006#[doc = "Send raw controller memory. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
19007#[doc = ""]
19008#[doc = "ID: 249"]
19009#[derive(Debug, Clone, PartialEq)]
19010#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19011#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19012#[cfg_attr(feature = "ts", derive(TS))]
19013#[cfg_attr(feature = "ts", ts(export))]
19014pub struct MEMORY_VECT_DATA {
19015 #[doc = "Starting address of the debug variables"]
19016 pub address: u16,
19017 #[doc = "Version code of the type variable. 0=unknown, type ignored and assumed int16_t. 1=as below"]
19018 pub ver: u8,
19019 #[doc = "Type code of the memory variables. for ver = 1: 0=16 x int16_t, 1=16 x uint16_t, 2=16 x Q15, 3=16 x 1Q14"]
19020 pub mavtype: u8,
19021 #[doc = "Memory contents at specified address"]
19022 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
19023 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
19024 pub value: [i8; 32],
19025}
19026impl MEMORY_VECT_DATA {
19027 pub const ENCODED_LEN: usize = 36usize;
19028 pub const DEFAULT: Self = Self {
19029 address: 0_u16,
19030 ver: 0_u8,
19031 mavtype: 0_u8,
19032 value: [0_i8; 32usize],
19033 };
19034 #[cfg(feature = "arbitrary")]
19035 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19036 use arbitrary::{Arbitrary, Unstructured};
19037 let mut buf = [0u8; 1024];
19038 rng.fill_bytes(&mut buf);
19039 let mut unstructured = Unstructured::new(&buf);
19040 Self::arbitrary(&mut unstructured).unwrap_or_default()
19041 }
19042}
19043impl Default for MEMORY_VECT_DATA {
19044 fn default() -> Self {
19045 Self::DEFAULT.clone()
19046 }
19047}
19048impl MessageData for MEMORY_VECT_DATA {
19049 type Message = MavMessage;
19050 const ID: u32 = 249u32;
19051 const NAME: &'static str = "MEMORY_VECT";
19052 const EXTRA_CRC: u8 = 204u8;
19053 const ENCODED_LEN: usize = 36usize;
19054 fn deser(
19055 _version: MavlinkVersion,
19056 __input: &[u8],
19057 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19058 let avail_len = __input.len();
19059 let mut payload_buf = [0; Self::ENCODED_LEN];
19060 let mut buf = if avail_len < Self::ENCODED_LEN {
19061 payload_buf[0..avail_len].copy_from_slice(__input);
19062 Bytes::new(&payload_buf)
19063 } else {
19064 Bytes::new(__input)
19065 };
19066 let mut __struct = Self::default();
19067 __struct.address = buf.get_u16_le();
19068 __struct.ver = buf.get_u8();
19069 __struct.mavtype = buf.get_u8();
19070 for v in &mut __struct.value {
19071 let val = buf.get_i8();
19072 *v = val;
19073 }
19074 Ok(__struct)
19075 }
19076 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19077 let mut __tmp = BytesMut::new(bytes);
19078 #[allow(clippy::absurd_extreme_comparisons)]
19079 #[allow(unused_comparisons)]
19080 if __tmp.remaining() < Self::ENCODED_LEN {
19081 panic!(
19082 "buffer is too small (need {} bytes, but got {})",
19083 Self::ENCODED_LEN,
19084 __tmp.remaining(),
19085 )
19086 }
19087 __tmp.put_u16_le(self.address);
19088 __tmp.put_u8(self.ver);
19089 __tmp.put_u8(self.mavtype);
19090 for val in &self.value {
19091 __tmp.put_i8(*val);
19092 }
19093 if matches!(version, MavlinkVersion::V2) {
19094 let len = __tmp.len();
19095 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19096 } else {
19097 __tmp.len()
19098 }
19099 }
19100}
19101#[doc = "The interval between messages for a particular MAVLink message ID. This message is sent in response to the MAV_CMD_REQUEST_MESSAGE command with param1=244 (this message) and param2=message_id (the id of the message for which the interval is required). \tIt may also be sent in response to MAV_CMD_GET_MESSAGE_INTERVAL. \tThis interface replaces DATA_STREAM."]
19102#[doc = ""]
19103#[doc = "ID: 244"]
19104#[derive(Debug, Clone, PartialEq)]
19105#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19106#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19107#[cfg_attr(feature = "ts", derive(TS))]
19108#[cfg_attr(feature = "ts", ts(export))]
19109pub struct MESSAGE_INTERVAL_DATA {
19110 #[doc = "0 indicates the interval at which it is sent."]
19111 pub interval_us: i32,
19112 #[doc = "The ID of the requested MAVLink message. v1.0 is limited to 254 messages."]
19113 pub message_id: u16,
19114}
19115impl MESSAGE_INTERVAL_DATA {
19116 pub const ENCODED_LEN: usize = 6usize;
19117 pub const DEFAULT: Self = Self {
19118 interval_us: 0_i32,
19119 message_id: 0_u16,
19120 };
19121 #[cfg(feature = "arbitrary")]
19122 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19123 use arbitrary::{Arbitrary, Unstructured};
19124 let mut buf = [0u8; 1024];
19125 rng.fill_bytes(&mut buf);
19126 let mut unstructured = Unstructured::new(&buf);
19127 Self::arbitrary(&mut unstructured).unwrap_or_default()
19128 }
19129}
19130impl Default for MESSAGE_INTERVAL_DATA {
19131 fn default() -> Self {
19132 Self::DEFAULT.clone()
19133 }
19134}
19135impl MessageData for MESSAGE_INTERVAL_DATA {
19136 type Message = MavMessage;
19137 const ID: u32 = 244u32;
19138 const NAME: &'static str = "MESSAGE_INTERVAL";
19139 const EXTRA_CRC: u8 = 95u8;
19140 const ENCODED_LEN: usize = 6usize;
19141 fn deser(
19142 _version: MavlinkVersion,
19143 __input: &[u8],
19144 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19145 let avail_len = __input.len();
19146 let mut payload_buf = [0; Self::ENCODED_LEN];
19147 let mut buf = if avail_len < Self::ENCODED_LEN {
19148 payload_buf[0..avail_len].copy_from_slice(__input);
19149 Bytes::new(&payload_buf)
19150 } else {
19151 Bytes::new(__input)
19152 };
19153 let mut __struct = Self::default();
19154 __struct.interval_us = buf.get_i32_le();
19155 __struct.message_id = buf.get_u16_le();
19156 Ok(__struct)
19157 }
19158 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19159 let mut __tmp = BytesMut::new(bytes);
19160 #[allow(clippy::absurd_extreme_comparisons)]
19161 #[allow(unused_comparisons)]
19162 if __tmp.remaining() < Self::ENCODED_LEN {
19163 panic!(
19164 "buffer is too small (need {} bytes, but got {})",
19165 Self::ENCODED_LEN,
19166 __tmp.remaining(),
19167 )
19168 }
19169 __tmp.put_i32_le(self.interval_us);
19170 __tmp.put_u16_le(self.message_id);
19171 if matches!(version, MavlinkVersion::V2) {
19172 let len = __tmp.len();
19173 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19174 } else {
19175 __tmp.len()
19176 }
19177 }
19178}
19179#[doc = "Acknowledgment message during waypoint handling. The type field states if this message is a positive ack (type=0) or if an error happened (type=non-zero)."]
19180#[doc = ""]
19181#[doc = "ID: 47"]
19182#[derive(Debug, Clone, PartialEq)]
19183#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19184#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19185#[cfg_attr(feature = "ts", derive(TS))]
19186#[cfg_attr(feature = "ts", ts(export))]
19187pub struct MISSION_ACK_DATA {
19188 #[doc = "System ID"]
19189 pub target_system: u8,
19190 #[doc = "Component ID"]
19191 pub target_component: u8,
19192 #[doc = "Mission result."]
19193 pub mavtype: MavMissionResult,
19194 #[doc = "Mission type."]
19195 #[cfg_attr(feature = "serde", serde(default))]
19196 pub mission_type: MavMissionType,
19197 #[doc = "Id of new on-vehicle mission, fence, or rally point plan (on upload to vehicle). The id is calculated and returned by a vehicle when a new plan is uploaded by a GCS. The only requirement on the id is that it must change when there is any change to the on-vehicle plan type (there is no requirement that the id be globally unique). 0 on download from the vehicle to the GCS (on download the ID is set in MISSION_COUNT). 0 if plan ids are not supported. The current on-vehicle plan ids are streamed in `MISSION_CURRENT`, allowing a GCS to determine if any part of the plan has changed and needs to be re-uploaded."]
19198 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19199 pub opaque_id: u32,
19200}
19201impl MISSION_ACK_DATA {
19202 pub const ENCODED_LEN: usize = 8usize;
19203 pub const DEFAULT: Self = Self {
19204 target_system: 0_u8,
19205 target_component: 0_u8,
19206 mavtype: MavMissionResult::DEFAULT,
19207 mission_type: MavMissionType::DEFAULT,
19208 opaque_id: 0_u32,
19209 };
19210 #[cfg(feature = "arbitrary")]
19211 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19212 use arbitrary::{Arbitrary, Unstructured};
19213 let mut buf = [0u8; 1024];
19214 rng.fill_bytes(&mut buf);
19215 let mut unstructured = Unstructured::new(&buf);
19216 Self::arbitrary(&mut unstructured).unwrap_or_default()
19217 }
19218}
19219impl Default for MISSION_ACK_DATA {
19220 fn default() -> Self {
19221 Self::DEFAULT.clone()
19222 }
19223}
19224impl MessageData for MISSION_ACK_DATA {
19225 type Message = MavMessage;
19226 const ID: u32 = 47u32;
19227 const NAME: &'static str = "MISSION_ACK";
19228 const EXTRA_CRC: u8 = 153u8;
19229 const ENCODED_LEN: usize = 8usize;
19230 fn deser(
19231 _version: MavlinkVersion,
19232 __input: &[u8],
19233 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19234 let avail_len = __input.len();
19235 let mut payload_buf = [0; Self::ENCODED_LEN];
19236 let mut buf = if avail_len < Self::ENCODED_LEN {
19237 payload_buf[0..avail_len].copy_from_slice(__input);
19238 Bytes::new(&payload_buf)
19239 } else {
19240 Bytes::new(__input)
19241 };
19242 let mut __struct = Self::default();
19243 __struct.target_system = buf.get_u8();
19244 __struct.target_component = buf.get_u8();
19245 let tmp = buf.get_u8();
19246 __struct.mavtype =
19247 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19248 enum_type: "MavMissionResult",
19249 value: tmp as u64,
19250 })?;
19251 let tmp = buf.get_u8();
19252 __struct.mission_type =
19253 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19254 enum_type: "MavMissionType",
19255 value: tmp as u64,
19256 })?;
19257 __struct.opaque_id = buf.get_u32_le();
19258 Ok(__struct)
19259 }
19260 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19261 let mut __tmp = BytesMut::new(bytes);
19262 #[allow(clippy::absurd_extreme_comparisons)]
19263 #[allow(unused_comparisons)]
19264 if __tmp.remaining() < Self::ENCODED_LEN {
19265 panic!(
19266 "buffer is too small (need {} bytes, but got {})",
19267 Self::ENCODED_LEN,
19268 __tmp.remaining(),
19269 )
19270 }
19271 __tmp.put_u8(self.target_system);
19272 __tmp.put_u8(self.target_component);
19273 __tmp.put_u8(self.mavtype as u8);
19274 if matches!(version, MavlinkVersion::V2) {
19275 __tmp.put_u8(self.mission_type as u8);
19276 __tmp.put_u32_le(self.opaque_id);
19277 let len = __tmp.len();
19278 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19279 } else {
19280 __tmp.len()
19281 }
19282 }
19283}
19284#[doc = "Delete all mission items at once."]
19285#[doc = ""]
19286#[doc = "ID: 45"]
19287#[derive(Debug, Clone, PartialEq)]
19288#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19289#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19290#[cfg_attr(feature = "ts", derive(TS))]
19291#[cfg_attr(feature = "ts", ts(export))]
19292pub struct MISSION_CLEAR_ALL_DATA {
19293 #[doc = "System ID"]
19294 pub target_system: u8,
19295 #[doc = "Component ID"]
19296 pub target_component: u8,
19297 #[doc = "Mission type."]
19298 #[cfg_attr(feature = "serde", serde(default))]
19299 pub mission_type: MavMissionType,
19300}
19301impl MISSION_CLEAR_ALL_DATA {
19302 pub const ENCODED_LEN: usize = 3usize;
19303 pub const DEFAULT: Self = Self {
19304 target_system: 0_u8,
19305 target_component: 0_u8,
19306 mission_type: MavMissionType::DEFAULT,
19307 };
19308 #[cfg(feature = "arbitrary")]
19309 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19310 use arbitrary::{Arbitrary, Unstructured};
19311 let mut buf = [0u8; 1024];
19312 rng.fill_bytes(&mut buf);
19313 let mut unstructured = Unstructured::new(&buf);
19314 Self::arbitrary(&mut unstructured).unwrap_or_default()
19315 }
19316}
19317impl Default for MISSION_CLEAR_ALL_DATA {
19318 fn default() -> Self {
19319 Self::DEFAULT.clone()
19320 }
19321}
19322impl MessageData for MISSION_CLEAR_ALL_DATA {
19323 type Message = MavMessage;
19324 const ID: u32 = 45u32;
19325 const NAME: &'static str = "MISSION_CLEAR_ALL";
19326 const EXTRA_CRC: u8 = 232u8;
19327 const ENCODED_LEN: usize = 3usize;
19328 fn deser(
19329 _version: MavlinkVersion,
19330 __input: &[u8],
19331 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19332 let avail_len = __input.len();
19333 let mut payload_buf = [0; Self::ENCODED_LEN];
19334 let mut buf = if avail_len < Self::ENCODED_LEN {
19335 payload_buf[0..avail_len].copy_from_slice(__input);
19336 Bytes::new(&payload_buf)
19337 } else {
19338 Bytes::new(__input)
19339 };
19340 let mut __struct = Self::default();
19341 __struct.target_system = buf.get_u8();
19342 __struct.target_component = buf.get_u8();
19343 let tmp = buf.get_u8();
19344 __struct.mission_type =
19345 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19346 enum_type: "MavMissionType",
19347 value: tmp as u64,
19348 })?;
19349 Ok(__struct)
19350 }
19351 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19352 let mut __tmp = BytesMut::new(bytes);
19353 #[allow(clippy::absurd_extreme_comparisons)]
19354 #[allow(unused_comparisons)]
19355 if __tmp.remaining() < Self::ENCODED_LEN {
19356 panic!(
19357 "buffer is too small (need {} bytes, but got {})",
19358 Self::ENCODED_LEN,
19359 __tmp.remaining(),
19360 )
19361 }
19362 __tmp.put_u8(self.target_system);
19363 __tmp.put_u8(self.target_component);
19364 if matches!(version, MavlinkVersion::V2) {
19365 __tmp.put_u8(self.mission_type as u8);
19366 let len = __tmp.len();
19367 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19368 } else {
19369 __tmp.len()
19370 }
19371 }
19372}
19373#[doc = "This message is emitted as response to MISSION_REQUEST_LIST by the MAV and to initiate a write transaction. The GCS can then request the individual mission item based on the knowledge of the total number of waypoints."]
19374#[doc = ""]
19375#[doc = "ID: 44"]
19376#[derive(Debug, Clone, PartialEq)]
19377#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19378#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19379#[cfg_attr(feature = "ts", derive(TS))]
19380#[cfg_attr(feature = "ts", ts(export))]
19381pub struct MISSION_COUNT_DATA {
19382 #[doc = "Number of mission items in the sequence"]
19383 pub count: u16,
19384 #[doc = "System ID"]
19385 pub target_system: u8,
19386 #[doc = "Component ID"]
19387 pub target_component: u8,
19388 #[doc = "Mission type."]
19389 #[cfg_attr(feature = "serde", serde(default))]
19390 pub mission_type: MavMissionType,
19391 #[doc = "Id of current on-vehicle mission, fence, or rally point plan (on download from vehicle). This field is used when downloading a plan from a vehicle to a GCS. 0 on upload to the vehicle from GCS. 0 if plan ids are not supported. The current on-vehicle plan ids are streamed in `MISSION_CURRENT`, allowing a GCS to determine if any part of the plan has changed and needs to be re-uploaded. The ids are recalculated by the vehicle when any part of the on-vehicle plan changes (when a new plan is uploaded, the vehicle returns the new id to the GCS in MISSION_ACK)."]
19392 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19393 pub opaque_id: u32,
19394}
19395impl MISSION_COUNT_DATA {
19396 pub const ENCODED_LEN: usize = 9usize;
19397 pub const DEFAULT: Self = Self {
19398 count: 0_u16,
19399 target_system: 0_u8,
19400 target_component: 0_u8,
19401 mission_type: MavMissionType::DEFAULT,
19402 opaque_id: 0_u32,
19403 };
19404 #[cfg(feature = "arbitrary")]
19405 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19406 use arbitrary::{Arbitrary, Unstructured};
19407 let mut buf = [0u8; 1024];
19408 rng.fill_bytes(&mut buf);
19409 let mut unstructured = Unstructured::new(&buf);
19410 Self::arbitrary(&mut unstructured).unwrap_or_default()
19411 }
19412}
19413impl Default for MISSION_COUNT_DATA {
19414 fn default() -> Self {
19415 Self::DEFAULT.clone()
19416 }
19417}
19418impl MessageData for MISSION_COUNT_DATA {
19419 type Message = MavMessage;
19420 const ID: u32 = 44u32;
19421 const NAME: &'static str = "MISSION_COUNT";
19422 const EXTRA_CRC: u8 = 221u8;
19423 const ENCODED_LEN: usize = 9usize;
19424 fn deser(
19425 _version: MavlinkVersion,
19426 __input: &[u8],
19427 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19428 let avail_len = __input.len();
19429 let mut payload_buf = [0; Self::ENCODED_LEN];
19430 let mut buf = if avail_len < Self::ENCODED_LEN {
19431 payload_buf[0..avail_len].copy_from_slice(__input);
19432 Bytes::new(&payload_buf)
19433 } else {
19434 Bytes::new(__input)
19435 };
19436 let mut __struct = Self::default();
19437 __struct.count = buf.get_u16_le();
19438 __struct.target_system = buf.get_u8();
19439 __struct.target_component = buf.get_u8();
19440 let tmp = buf.get_u8();
19441 __struct.mission_type =
19442 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19443 enum_type: "MavMissionType",
19444 value: tmp as u64,
19445 })?;
19446 __struct.opaque_id = buf.get_u32_le();
19447 Ok(__struct)
19448 }
19449 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19450 let mut __tmp = BytesMut::new(bytes);
19451 #[allow(clippy::absurd_extreme_comparisons)]
19452 #[allow(unused_comparisons)]
19453 if __tmp.remaining() < Self::ENCODED_LEN {
19454 panic!(
19455 "buffer is too small (need {} bytes, but got {})",
19456 Self::ENCODED_LEN,
19457 __tmp.remaining(),
19458 )
19459 }
19460 __tmp.put_u16_le(self.count);
19461 __tmp.put_u8(self.target_system);
19462 __tmp.put_u8(self.target_component);
19463 if matches!(version, MavlinkVersion::V2) {
19464 __tmp.put_u8(self.mission_type as u8);
19465 __tmp.put_u32_le(self.opaque_id);
19466 let len = __tmp.len();
19467 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19468 } else {
19469 __tmp.len()
19470 }
19471 }
19472}
19473#[doc = "Message that announces the sequence number of the current target mission item (that the system will fly towards/execute when the mission is running). This message should be streamed all the time (nominally at 1Hz). This message should be emitted following a call to MAV_CMD_DO_SET_MISSION_CURRENT or MISSION_SET_CURRENT."]
19474#[doc = ""]
19475#[doc = "ID: 42"]
19476#[derive(Debug, Clone, PartialEq)]
19477#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19478#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19479#[cfg_attr(feature = "ts", derive(TS))]
19480#[cfg_attr(feature = "ts", ts(export))]
19481pub struct MISSION_CURRENT_DATA {
19482 #[doc = "Sequence"]
19483 pub seq: u16,
19484 #[doc = "Total number of mission items on vehicle (on last item, sequence == total). If the autopilot stores its home location as part of the mission this will be excluded from the total. 0: Not supported, UINT16_MAX if no mission is present on the vehicle."]
19485 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19486 pub total: u16,
19487 #[doc = "Mission state machine state. MISSION_STATE_UNKNOWN if state reporting not supported."]
19488 #[cfg_attr(feature = "serde", serde(default))]
19489 pub mission_state: MissionState,
19490 #[doc = "Vehicle is in a mode that can execute mission items or suspended. 0: Unknown, 1: In mission mode, 2: Suspended (not in mission mode)."]
19491 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19492 pub mission_mode: u8,
19493 #[doc = "Id of current on-vehicle mission plan, or 0 if IDs are not supported or there is no mission loaded. GCS can use this to track changes to the mission plan type. The same value is returned on mission upload (in the MISSION_ACK)."]
19494 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19495 pub mission_id: u32,
19496 #[doc = "Id of current on-vehicle fence plan, or 0 if IDs are not supported or there is no fence loaded. GCS can use this to track changes to the fence plan type. The same value is returned on fence upload (in the MISSION_ACK)."]
19497 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19498 pub fence_id: u32,
19499 #[doc = "Id of current on-vehicle rally point plan, or 0 if IDs are not supported or there are no rally points loaded. GCS can use this to track changes to the rally point plan type. The same value is returned on rally point upload (in the MISSION_ACK)."]
19500 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19501 pub rally_points_id: u32,
19502}
19503impl MISSION_CURRENT_DATA {
19504 pub const ENCODED_LEN: usize = 18usize;
19505 pub const DEFAULT: Self = Self {
19506 seq: 0_u16,
19507 total: 0_u16,
19508 mission_state: MissionState::DEFAULT,
19509 mission_mode: 0_u8,
19510 mission_id: 0_u32,
19511 fence_id: 0_u32,
19512 rally_points_id: 0_u32,
19513 };
19514 #[cfg(feature = "arbitrary")]
19515 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19516 use arbitrary::{Arbitrary, Unstructured};
19517 let mut buf = [0u8; 1024];
19518 rng.fill_bytes(&mut buf);
19519 let mut unstructured = Unstructured::new(&buf);
19520 Self::arbitrary(&mut unstructured).unwrap_or_default()
19521 }
19522}
19523impl Default for MISSION_CURRENT_DATA {
19524 fn default() -> Self {
19525 Self::DEFAULT.clone()
19526 }
19527}
19528impl MessageData for MISSION_CURRENT_DATA {
19529 type Message = MavMessage;
19530 const ID: u32 = 42u32;
19531 const NAME: &'static str = "MISSION_CURRENT";
19532 const EXTRA_CRC: u8 = 28u8;
19533 const ENCODED_LEN: usize = 18usize;
19534 fn deser(
19535 _version: MavlinkVersion,
19536 __input: &[u8],
19537 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19538 let avail_len = __input.len();
19539 let mut payload_buf = [0; Self::ENCODED_LEN];
19540 let mut buf = if avail_len < Self::ENCODED_LEN {
19541 payload_buf[0..avail_len].copy_from_slice(__input);
19542 Bytes::new(&payload_buf)
19543 } else {
19544 Bytes::new(__input)
19545 };
19546 let mut __struct = Self::default();
19547 __struct.seq = buf.get_u16_le();
19548 __struct.total = buf.get_u16_le();
19549 let tmp = buf.get_u8();
19550 __struct.mission_state =
19551 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19552 enum_type: "MissionState",
19553 value: tmp as u64,
19554 })?;
19555 __struct.mission_mode = buf.get_u8();
19556 __struct.mission_id = buf.get_u32_le();
19557 __struct.fence_id = buf.get_u32_le();
19558 __struct.rally_points_id = buf.get_u32_le();
19559 Ok(__struct)
19560 }
19561 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19562 let mut __tmp = BytesMut::new(bytes);
19563 #[allow(clippy::absurd_extreme_comparisons)]
19564 #[allow(unused_comparisons)]
19565 if __tmp.remaining() < Self::ENCODED_LEN {
19566 panic!(
19567 "buffer is too small (need {} bytes, but got {})",
19568 Self::ENCODED_LEN,
19569 __tmp.remaining(),
19570 )
19571 }
19572 __tmp.put_u16_le(self.seq);
19573 if matches!(version, MavlinkVersion::V2) {
19574 __tmp.put_u16_le(self.total);
19575 __tmp.put_u8(self.mission_state as u8);
19576 __tmp.put_u8(self.mission_mode);
19577 __tmp.put_u32_le(self.mission_id);
19578 __tmp.put_u32_le(self.fence_id);
19579 __tmp.put_u32_le(self.rally_points_id);
19580 let len = __tmp.len();
19581 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19582 } else {
19583 __tmp.len()
19584 }
19585 }
19586}
19587#[deprecated = " See `MISSION_ITEM_INT` (Deprecated since 2020-06)"]
19588#[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN may be used to indicate an optional/default value (e.g. to use the system's current latitude or yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
19589#[doc = ""]
19590#[doc = "ID: 39"]
19591#[derive(Debug, Clone, PartialEq)]
19592#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19593#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19594#[cfg_attr(feature = "ts", derive(TS))]
19595#[cfg_attr(feature = "ts", ts(export))]
19596pub struct MISSION_ITEM_DATA {
19597 #[doc = "PARAM1, see MAV_CMD enum"]
19598 pub param1: f32,
19599 #[doc = "PARAM2, see MAV_CMD enum"]
19600 pub param2: f32,
19601 #[doc = "PARAM3, see MAV_CMD enum"]
19602 pub param3: f32,
19603 #[doc = "PARAM4, see MAV_CMD enum"]
19604 pub param4: f32,
19605 #[doc = "PARAM5 / local: X coordinate, global: latitude"]
19606 pub x: f32,
19607 #[doc = "PARAM6 / local: Y coordinate, global: longitude"]
19608 pub y: f32,
19609 #[doc = "PARAM7 / local: Z coordinate, global: altitude (relative or absolute, depending on frame)."]
19610 pub z: f32,
19611 #[doc = "Sequence"]
19612 pub seq: u16,
19613 #[doc = "The scheduled action for the waypoint."]
19614 pub command: MavCmd,
19615 #[doc = "System ID"]
19616 pub target_system: u8,
19617 #[doc = "Component ID"]
19618 pub target_component: u8,
19619 #[doc = "The coordinate system of the waypoint."]
19620 pub frame: MavFrame,
19621 #[doc = "false:0, true:1"]
19622 pub current: u8,
19623 #[doc = "Autocontinue to next waypoint. 0: false, 1: true. Set false to pause mission after the item completes."]
19624 pub autocontinue: u8,
19625 #[doc = "Mission type."]
19626 #[cfg_attr(feature = "serde", serde(default))]
19627 pub mission_type: MavMissionType,
19628}
19629impl MISSION_ITEM_DATA {
19630 pub const ENCODED_LEN: usize = 38usize;
19631 pub const DEFAULT: Self = Self {
19632 param1: 0.0_f32,
19633 param2: 0.0_f32,
19634 param3: 0.0_f32,
19635 param4: 0.0_f32,
19636 x: 0.0_f32,
19637 y: 0.0_f32,
19638 z: 0.0_f32,
19639 seq: 0_u16,
19640 command: MavCmd::DEFAULT,
19641 target_system: 0_u8,
19642 target_component: 0_u8,
19643 frame: MavFrame::DEFAULT,
19644 current: 0_u8,
19645 autocontinue: 0_u8,
19646 mission_type: MavMissionType::DEFAULT,
19647 };
19648 #[cfg(feature = "arbitrary")]
19649 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19650 use arbitrary::{Arbitrary, Unstructured};
19651 let mut buf = [0u8; 1024];
19652 rng.fill_bytes(&mut buf);
19653 let mut unstructured = Unstructured::new(&buf);
19654 Self::arbitrary(&mut unstructured).unwrap_or_default()
19655 }
19656}
19657impl Default for MISSION_ITEM_DATA {
19658 fn default() -> Self {
19659 Self::DEFAULT.clone()
19660 }
19661}
19662impl MessageData for MISSION_ITEM_DATA {
19663 type Message = MavMessage;
19664 const ID: u32 = 39u32;
19665 const NAME: &'static str = "MISSION_ITEM";
19666 const EXTRA_CRC: u8 = 254u8;
19667 const ENCODED_LEN: usize = 38usize;
19668 fn deser(
19669 _version: MavlinkVersion,
19670 __input: &[u8],
19671 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19672 let avail_len = __input.len();
19673 let mut payload_buf = [0; Self::ENCODED_LEN];
19674 let mut buf = if avail_len < Self::ENCODED_LEN {
19675 payload_buf[0..avail_len].copy_from_slice(__input);
19676 Bytes::new(&payload_buf)
19677 } else {
19678 Bytes::new(__input)
19679 };
19680 let mut __struct = Self::default();
19681 __struct.param1 = buf.get_f32_le();
19682 __struct.param2 = buf.get_f32_le();
19683 __struct.param3 = buf.get_f32_le();
19684 __struct.param4 = buf.get_f32_le();
19685 __struct.x = buf.get_f32_le();
19686 __struct.y = buf.get_f32_le();
19687 __struct.z = buf.get_f32_le();
19688 __struct.seq = buf.get_u16_le();
19689 let tmp = buf.get_u16_le();
19690 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
19691 ::mavlink_core::error::ParserError::InvalidEnum {
19692 enum_type: "MavCmd",
19693 value: tmp as u64,
19694 },
19695 )?;
19696 __struct.target_system = buf.get_u8();
19697 __struct.target_component = buf.get_u8();
19698 let tmp = buf.get_u8();
19699 __struct.frame =
19700 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19701 enum_type: "MavFrame",
19702 value: tmp as u64,
19703 })?;
19704 __struct.current = buf.get_u8();
19705 __struct.autocontinue = buf.get_u8();
19706 let tmp = buf.get_u8();
19707 __struct.mission_type =
19708 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19709 enum_type: "MavMissionType",
19710 value: tmp as u64,
19711 })?;
19712 Ok(__struct)
19713 }
19714 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19715 let mut __tmp = BytesMut::new(bytes);
19716 #[allow(clippy::absurd_extreme_comparisons)]
19717 #[allow(unused_comparisons)]
19718 if __tmp.remaining() < Self::ENCODED_LEN {
19719 panic!(
19720 "buffer is too small (need {} bytes, but got {})",
19721 Self::ENCODED_LEN,
19722 __tmp.remaining(),
19723 )
19724 }
19725 __tmp.put_f32_le(self.param1);
19726 __tmp.put_f32_le(self.param2);
19727 __tmp.put_f32_le(self.param3);
19728 __tmp.put_f32_le(self.param4);
19729 __tmp.put_f32_le(self.x);
19730 __tmp.put_f32_le(self.y);
19731 __tmp.put_f32_le(self.z);
19732 __tmp.put_u16_le(self.seq);
19733 __tmp.put_u16_le(self.command as u16);
19734 __tmp.put_u8(self.target_system);
19735 __tmp.put_u8(self.target_component);
19736 __tmp.put_u8(self.frame as u8);
19737 __tmp.put_u8(self.current);
19738 __tmp.put_u8(self.autocontinue);
19739 if matches!(version, MavlinkVersion::V2) {
19740 __tmp.put_u8(self.mission_type as u8);
19741 let len = __tmp.len();
19742 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19743 } else {
19744 __tmp.len()
19745 }
19746 }
19747}
19748#[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
19749#[doc = ""]
19750#[doc = "ID: 73"]
19751#[derive(Debug, Clone, PartialEq)]
19752#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19753#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19754#[cfg_attr(feature = "ts", derive(TS))]
19755#[cfg_attr(feature = "ts", ts(export))]
19756pub struct MISSION_ITEM_INT_DATA {
19757 #[doc = "PARAM1, see MAV_CMD enum"]
19758 pub param1: f32,
19759 #[doc = "PARAM2, see MAV_CMD enum"]
19760 pub param2: f32,
19761 #[doc = "PARAM3, see MAV_CMD enum"]
19762 pub param3: f32,
19763 #[doc = "PARAM4, see MAV_CMD enum"]
19764 pub param4: f32,
19765 #[doc = "PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7"]
19766 pub x: i32,
19767 #[doc = "PARAM6 / y position: local: x position in meters * 1e4, global: longitude in degrees *10^7"]
19768 pub y: i32,
19769 #[doc = "PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame."]
19770 pub z: f32,
19771 #[doc = "Waypoint ID (sequence number). Starts at zero. Increases monotonically for each waypoint, no gaps in the sequence (0,1,2,3,4)."]
19772 pub seq: u16,
19773 #[doc = "The scheduled action for the waypoint."]
19774 pub command: MavCmd,
19775 #[doc = "System ID"]
19776 pub target_system: u8,
19777 #[doc = "Component ID"]
19778 pub target_component: u8,
19779 #[doc = "The coordinate system of the waypoint."]
19780 pub frame: MavFrame,
19781 #[doc = "false:0, true:1"]
19782 pub current: u8,
19783 #[doc = "Autocontinue to next waypoint. 0: false, 1: true. Set false to pause mission after the item completes."]
19784 pub autocontinue: u8,
19785 #[doc = "Mission type."]
19786 #[cfg_attr(feature = "serde", serde(default))]
19787 pub mission_type: MavMissionType,
19788}
19789impl MISSION_ITEM_INT_DATA {
19790 pub const ENCODED_LEN: usize = 38usize;
19791 pub const DEFAULT: Self = Self {
19792 param1: 0.0_f32,
19793 param2: 0.0_f32,
19794 param3: 0.0_f32,
19795 param4: 0.0_f32,
19796 x: 0_i32,
19797 y: 0_i32,
19798 z: 0.0_f32,
19799 seq: 0_u16,
19800 command: MavCmd::DEFAULT,
19801 target_system: 0_u8,
19802 target_component: 0_u8,
19803 frame: MavFrame::DEFAULT,
19804 current: 0_u8,
19805 autocontinue: 0_u8,
19806 mission_type: MavMissionType::DEFAULT,
19807 };
19808 #[cfg(feature = "arbitrary")]
19809 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19810 use arbitrary::{Arbitrary, Unstructured};
19811 let mut buf = [0u8; 1024];
19812 rng.fill_bytes(&mut buf);
19813 let mut unstructured = Unstructured::new(&buf);
19814 Self::arbitrary(&mut unstructured).unwrap_or_default()
19815 }
19816}
19817impl Default for MISSION_ITEM_INT_DATA {
19818 fn default() -> Self {
19819 Self::DEFAULT.clone()
19820 }
19821}
19822impl MessageData for MISSION_ITEM_INT_DATA {
19823 type Message = MavMessage;
19824 const ID: u32 = 73u32;
19825 const NAME: &'static str = "MISSION_ITEM_INT";
19826 const EXTRA_CRC: u8 = 38u8;
19827 const ENCODED_LEN: usize = 38usize;
19828 fn deser(
19829 _version: MavlinkVersion,
19830 __input: &[u8],
19831 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19832 let avail_len = __input.len();
19833 let mut payload_buf = [0; Self::ENCODED_LEN];
19834 let mut buf = if avail_len < Self::ENCODED_LEN {
19835 payload_buf[0..avail_len].copy_from_slice(__input);
19836 Bytes::new(&payload_buf)
19837 } else {
19838 Bytes::new(__input)
19839 };
19840 let mut __struct = Self::default();
19841 __struct.param1 = buf.get_f32_le();
19842 __struct.param2 = buf.get_f32_le();
19843 __struct.param3 = buf.get_f32_le();
19844 __struct.param4 = buf.get_f32_le();
19845 __struct.x = buf.get_i32_le();
19846 __struct.y = buf.get_i32_le();
19847 __struct.z = buf.get_f32_le();
19848 __struct.seq = buf.get_u16_le();
19849 let tmp = buf.get_u16_le();
19850 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
19851 ::mavlink_core::error::ParserError::InvalidEnum {
19852 enum_type: "MavCmd",
19853 value: tmp as u64,
19854 },
19855 )?;
19856 __struct.target_system = buf.get_u8();
19857 __struct.target_component = buf.get_u8();
19858 let tmp = buf.get_u8();
19859 __struct.frame =
19860 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19861 enum_type: "MavFrame",
19862 value: tmp as u64,
19863 })?;
19864 __struct.current = buf.get_u8();
19865 __struct.autocontinue = buf.get_u8();
19866 let tmp = buf.get_u8();
19867 __struct.mission_type =
19868 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19869 enum_type: "MavMissionType",
19870 value: tmp as u64,
19871 })?;
19872 Ok(__struct)
19873 }
19874 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19875 let mut __tmp = BytesMut::new(bytes);
19876 #[allow(clippy::absurd_extreme_comparisons)]
19877 #[allow(unused_comparisons)]
19878 if __tmp.remaining() < Self::ENCODED_LEN {
19879 panic!(
19880 "buffer is too small (need {} bytes, but got {})",
19881 Self::ENCODED_LEN,
19882 __tmp.remaining(),
19883 )
19884 }
19885 __tmp.put_f32_le(self.param1);
19886 __tmp.put_f32_le(self.param2);
19887 __tmp.put_f32_le(self.param3);
19888 __tmp.put_f32_le(self.param4);
19889 __tmp.put_i32_le(self.x);
19890 __tmp.put_i32_le(self.y);
19891 __tmp.put_f32_le(self.z);
19892 __tmp.put_u16_le(self.seq);
19893 __tmp.put_u16_le(self.command as u16);
19894 __tmp.put_u8(self.target_system);
19895 __tmp.put_u8(self.target_component);
19896 __tmp.put_u8(self.frame as u8);
19897 __tmp.put_u8(self.current);
19898 __tmp.put_u8(self.autocontinue);
19899 if matches!(version, MavlinkVersion::V2) {
19900 __tmp.put_u8(self.mission_type as u8);
19901 let len = __tmp.len();
19902 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19903 } else {
19904 __tmp.len()
19905 }
19906 }
19907}
19908#[doc = "A certain mission item has been reached. The system will either hold this position (or circle on the orbit) or (if the autocontinue on the WP was set) continue to the next waypoint."]
19909#[doc = ""]
19910#[doc = "ID: 46"]
19911#[derive(Debug, Clone, PartialEq)]
19912#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19913#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19914#[cfg_attr(feature = "ts", derive(TS))]
19915#[cfg_attr(feature = "ts", ts(export))]
19916pub struct MISSION_ITEM_REACHED_DATA {
19917 #[doc = "Sequence"]
19918 pub seq: u16,
19919}
19920impl MISSION_ITEM_REACHED_DATA {
19921 pub const ENCODED_LEN: usize = 2usize;
19922 pub const DEFAULT: Self = Self { seq: 0_u16 };
19923 #[cfg(feature = "arbitrary")]
19924 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19925 use arbitrary::{Arbitrary, Unstructured};
19926 let mut buf = [0u8; 1024];
19927 rng.fill_bytes(&mut buf);
19928 let mut unstructured = Unstructured::new(&buf);
19929 Self::arbitrary(&mut unstructured).unwrap_or_default()
19930 }
19931}
19932impl Default for MISSION_ITEM_REACHED_DATA {
19933 fn default() -> Self {
19934 Self::DEFAULT.clone()
19935 }
19936}
19937impl MessageData for MISSION_ITEM_REACHED_DATA {
19938 type Message = MavMessage;
19939 const ID: u32 = 46u32;
19940 const NAME: &'static str = "MISSION_ITEM_REACHED";
19941 const EXTRA_CRC: u8 = 11u8;
19942 const ENCODED_LEN: usize = 2usize;
19943 fn deser(
19944 _version: MavlinkVersion,
19945 __input: &[u8],
19946 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19947 let avail_len = __input.len();
19948 let mut payload_buf = [0; Self::ENCODED_LEN];
19949 let mut buf = if avail_len < Self::ENCODED_LEN {
19950 payload_buf[0..avail_len].copy_from_slice(__input);
19951 Bytes::new(&payload_buf)
19952 } else {
19953 Bytes::new(__input)
19954 };
19955 let mut __struct = Self::default();
19956 __struct.seq = buf.get_u16_le();
19957 Ok(__struct)
19958 }
19959 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19960 let mut __tmp = BytesMut::new(bytes);
19961 #[allow(clippy::absurd_extreme_comparisons)]
19962 #[allow(unused_comparisons)]
19963 if __tmp.remaining() < Self::ENCODED_LEN {
19964 panic!(
19965 "buffer is too small (need {} bytes, but got {})",
19966 Self::ENCODED_LEN,
19967 __tmp.remaining(),
19968 )
19969 }
19970 __tmp.put_u16_le(self.seq);
19971 if matches!(version, MavlinkVersion::V2) {
19972 let len = __tmp.len();
19973 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19974 } else {
19975 __tmp.len()
19976 }
19977 }
19978}
19979#[deprecated = "A system that gets this request should respond with MISSION_ITEM_INT (as though MISSION_REQUEST_INT was received). See `MISSION_REQUEST_INT` (Deprecated since 2020-06)"]
19980#[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM message. <https://mavlink.io/en/services/mission.html>."]
19981#[doc = ""]
19982#[doc = "ID: 40"]
19983#[derive(Debug, Clone, PartialEq)]
19984#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19985#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19986#[cfg_attr(feature = "ts", derive(TS))]
19987#[cfg_attr(feature = "ts", ts(export))]
19988pub struct MISSION_REQUEST_DATA {
19989 #[doc = "Sequence"]
19990 pub seq: u16,
19991 #[doc = "System ID"]
19992 pub target_system: u8,
19993 #[doc = "Component ID"]
19994 pub target_component: u8,
19995 #[doc = "Mission type."]
19996 #[cfg_attr(feature = "serde", serde(default))]
19997 pub mission_type: MavMissionType,
19998}
19999impl MISSION_REQUEST_DATA {
20000 pub const ENCODED_LEN: usize = 5usize;
20001 pub const DEFAULT: Self = Self {
20002 seq: 0_u16,
20003 target_system: 0_u8,
20004 target_component: 0_u8,
20005 mission_type: MavMissionType::DEFAULT,
20006 };
20007 #[cfg(feature = "arbitrary")]
20008 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20009 use arbitrary::{Arbitrary, Unstructured};
20010 let mut buf = [0u8; 1024];
20011 rng.fill_bytes(&mut buf);
20012 let mut unstructured = Unstructured::new(&buf);
20013 Self::arbitrary(&mut unstructured).unwrap_or_default()
20014 }
20015}
20016impl Default for MISSION_REQUEST_DATA {
20017 fn default() -> Self {
20018 Self::DEFAULT.clone()
20019 }
20020}
20021impl MessageData for MISSION_REQUEST_DATA {
20022 type Message = MavMessage;
20023 const ID: u32 = 40u32;
20024 const NAME: &'static str = "MISSION_REQUEST";
20025 const EXTRA_CRC: u8 = 230u8;
20026 const ENCODED_LEN: usize = 5usize;
20027 fn deser(
20028 _version: MavlinkVersion,
20029 __input: &[u8],
20030 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20031 let avail_len = __input.len();
20032 let mut payload_buf = [0; Self::ENCODED_LEN];
20033 let mut buf = if avail_len < Self::ENCODED_LEN {
20034 payload_buf[0..avail_len].copy_from_slice(__input);
20035 Bytes::new(&payload_buf)
20036 } else {
20037 Bytes::new(__input)
20038 };
20039 let mut __struct = Self::default();
20040 __struct.seq = buf.get_u16_le();
20041 __struct.target_system = buf.get_u8();
20042 __struct.target_component = buf.get_u8();
20043 let tmp = buf.get_u8();
20044 __struct.mission_type =
20045 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20046 enum_type: "MavMissionType",
20047 value: tmp as u64,
20048 })?;
20049 Ok(__struct)
20050 }
20051 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20052 let mut __tmp = BytesMut::new(bytes);
20053 #[allow(clippy::absurd_extreme_comparisons)]
20054 #[allow(unused_comparisons)]
20055 if __tmp.remaining() < Self::ENCODED_LEN {
20056 panic!(
20057 "buffer is too small (need {} bytes, but got {})",
20058 Self::ENCODED_LEN,
20059 __tmp.remaining(),
20060 )
20061 }
20062 __tmp.put_u16_le(self.seq);
20063 __tmp.put_u8(self.target_system);
20064 __tmp.put_u8(self.target_component);
20065 if matches!(version, MavlinkVersion::V2) {
20066 __tmp.put_u8(self.mission_type as u8);
20067 let len = __tmp.len();
20068 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20069 } else {
20070 __tmp.len()
20071 }
20072 }
20073}
20074#[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM_INT message. <https://mavlink.io/en/services/mission.html>."]
20075#[doc = ""]
20076#[doc = "ID: 51"]
20077#[derive(Debug, Clone, PartialEq)]
20078#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20079#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20080#[cfg_attr(feature = "ts", derive(TS))]
20081#[cfg_attr(feature = "ts", ts(export))]
20082pub struct MISSION_REQUEST_INT_DATA {
20083 #[doc = "Sequence"]
20084 pub seq: u16,
20085 #[doc = "System ID"]
20086 pub target_system: u8,
20087 #[doc = "Component ID"]
20088 pub target_component: u8,
20089 #[doc = "Mission type."]
20090 #[cfg_attr(feature = "serde", serde(default))]
20091 pub mission_type: MavMissionType,
20092}
20093impl MISSION_REQUEST_INT_DATA {
20094 pub const ENCODED_LEN: usize = 5usize;
20095 pub const DEFAULT: Self = Self {
20096 seq: 0_u16,
20097 target_system: 0_u8,
20098 target_component: 0_u8,
20099 mission_type: MavMissionType::DEFAULT,
20100 };
20101 #[cfg(feature = "arbitrary")]
20102 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20103 use arbitrary::{Arbitrary, Unstructured};
20104 let mut buf = [0u8; 1024];
20105 rng.fill_bytes(&mut buf);
20106 let mut unstructured = Unstructured::new(&buf);
20107 Self::arbitrary(&mut unstructured).unwrap_or_default()
20108 }
20109}
20110impl Default for MISSION_REQUEST_INT_DATA {
20111 fn default() -> Self {
20112 Self::DEFAULT.clone()
20113 }
20114}
20115impl MessageData for MISSION_REQUEST_INT_DATA {
20116 type Message = MavMessage;
20117 const ID: u32 = 51u32;
20118 const NAME: &'static str = "MISSION_REQUEST_INT";
20119 const EXTRA_CRC: u8 = 196u8;
20120 const ENCODED_LEN: usize = 5usize;
20121 fn deser(
20122 _version: MavlinkVersion,
20123 __input: &[u8],
20124 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20125 let avail_len = __input.len();
20126 let mut payload_buf = [0; Self::ENCODED_LEN];
20127 let mut buf = if avail_len < Self::ENCODED_LEN {
20128 payload_buf[0..avail_len].copy_from_slice(__input);
20129 Bytes::new(&payload_buf)
20130 } else {
20131 Bytes::new(__input)
20132 };
20133 let mut __struct = Self::default();
20134 __struct.seq = buf.get_u16_le();
20135 __struct.target_system = buf.get_u8();
20136 __struct.target_component = buf.get_u8();
20137 let tmp = buf.get_u8();
20138 __struct.mission_type =
20139 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20140 enum_type: "MavMissionType",
20141 value: tmp as u64,
20142 })?;
20143 Ok(__struct)
20144 }
20145 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20146 let mut __tmp = BytesMut::new(bytes);
20147 #[allow(clippy::absurd_extreme_comparisons)]
20148 #[allow(unused_comparisons)]
20149 if __tmp.remaining() < Self::ENCODED_LEN {
20150 panic!(
20151 "buffer is too small (need {} bytes, but got {})",
20152 Self::ENCODED_LEN,
20153 __tmp.remaining(),
20154 )
20155 }
20156 __tmp.put_u16_le(self.seq);
20157 __tmp.put_u8(self.target_system);
20158 __tmp.put_u8(self.target_component);
20159 if matches!(version, MavlinkVersion::V2) {
20160 __tmp.put_u8(self.mission_type as u8);
20161 let len = __tmp.len();
20162 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20163 } else {
20164 __tmp.len()
20165 }
20166 }
20167}
20168#[doc = "Request the overall list of mission items from the system/component."]
20169#[doc = ""]
20170#[doc = "ID: 43"]
20171#[derive(Debug, Clone, PartialEq)]
20172#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20173#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20174#[cfg_attr(feature = "ts", derive(TS))]
20175#[cfg_attr(feature = "ts", ts(export))]
20176pub struct MISSION_REQUEST_LIST_DATA {
20177 #[doc = "System ID"]
20178 pub target_system: u8,
20179 #[doc = "Component ID"]
20180 pub target_component: u8,
20181 #[doc = "Mission type."]
20182 #[cfg_attr(feature = "serde", serde(default))]
20183 pub mission_type: MavMissionType,
20184}
20185impl MISSION_REQUEST_LIST_DATA {
20186 pub const ENCODED_LEN: usize = 3usize;
20187 pub const DEFAULT: Self = Self {
20188 target_system: 0_u8,
20189 target_component: 0_u8,
20190 mission_type: MavMissionType::DEFAULT,
20191 };
20192 #[cfg(feature = "arbitrary")]
20193 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20194 use arbitrary::{Arbitrary, Unstructured};
20195 let mut buf = [0u8; 1024];
20196 rng.fill_bytes(&mut buf);
20197 let mut unstructured = Unstructured::new(&buf);
20198 Self::arbitrary(&mut unstructured).unwrap_or_default()
20199 }
20200}
20201impl Default for MISSION_REQUEST_LIST_DATA {
20202 fn default() -> Self {
20203 Self::DEFAULT.clone()
20204 }
20205}
20206impl MessageData for MISSION_REQUEST_LIST_DATA {
20207 type Message = MavMessage;
20208 const ID: u32 = 43u32;
20209 const NAME: &'static str = "MISSION_REQUEST_LIST";
20210 const EXTRA_CRC: u8 = 132u8;
20211 const ENCODED_LEN: usize = 3usize;
20212 fn deser(
20213 _version: MavlinkVersion,
20214 __input: &[u8],
20215 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20216 let avail_len = __input.len();
20217 let mut payload_buf = [0; Self::ENCODED_LEN];
20218 let mut buf = if avail_len < Self::ENCODED_LEN {
20219 payload_buf[0..avail_len].copy_from_slice(__input);
20220 Bytes::new(&payload_buf)
20221 } else {
20222 Bytes::new(__input)
20223 };
20224 let mut __struct = Self::default();
20225 __struct.target_system = buf.get_u8();
20226 __struct.target_component = buf.get_u8();
20227 let tmp = buf.get_u8();
20228 __struct.mission_type =
20229 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20230 enum_type: "MavMissionType",
20231 value: tmp as u64,
20232 })?;
20233 Ok(__struct)
20234 }
20235 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20236 let mut __tmp = BytesMut::new(bytes);
20237 #[allow(clippy::absurd_extreme_comparisons)]
20238 #[allow(unused_comparisons)]
20239 if __tmp.remaining() < Self::ENCODED_LEN {
20240 panic!(
20241 "buffer is too small (need {} bytes, but got {})",
20242 Self::ENCODED_LEN,
20243 __tmp.remaining(),
20244 )
20245 }
20246 __tmp.put_u8(self.target_system);
20247 __tmp.put_u8(self.target_component);
20248 if matches!(version, MavlinkVersion::V2) {
20249 __tmp.put_u8(self.mission_type as u8);
20250 let len = __tmp.len();
20251 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20252 } else {
20253 __tmp.len()
20254 }
20255 }
20256}
20257#[doc = "Request a partial list of mission items from the system/component. <https://mavlink.io/en/services/mission.html>. If start and end index are the same, just send one waypoint."]
20258#[doc = ""]
20259#[doc = "ID: 37"]
20260#[derive(Debug, Clone, PartialEq)]
20261#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20262#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20263#[cfg_attr(feature = "ts", derive(TS))]
20264#[cfg_attr(feature = "ts", ts(export))]
20265pub struct MISSION_REQUEST_PARTIAL_LIST_DATA {
20266 #[doc = "Start index"]
20267 pub start_index: i16,
20268 #[doc = "End index, -1 by default (-1: send list to end). Else a valid index of the list"]
20269 pub end_index: i16,
20270 #[doc = "System ID"]
20271 pub target_system: u8,
20272 #[doc = "Component ID"]
20273 pub target_component: u8,
20274 #[doc = "Mission type."]
20275 #[cfg_attr(feature = "serde", serde(default))]
20276 pub mission_type: MavMissionType,
20277}
20278impl MISSION_REQUEST_PARTIAL_LIST_DATA {
20279 pub const ENCODED_LEN: usize = 7usize;
20280 pub const DEFAULT: Self = Self {
20281 start_index: 0_i16,
20282 end_index: 0_i16,
20283 target_system: 0_u8,
20284 target_component: 0_u8,
20285 mission_type: MavMissionType::DEFAULT,
20286 };
20287 #[cfg(feature = "arbitrary")]
20288 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20289 use arbitrary::{Arbitrary, Unstructured};
20290 let mut buf = [0u8; 1024];
20291 rng.fill_bytes(&mut buf);
20292 let mut unstructured = Unstructured::new(&buf);
20293 Self::arbitrary(&mut unstructured).unwrap_or_default()
20294 }
20295}
20296impl Default for MISSION_REQUEST_PARTIAL_LIST_DATA {
20297 fn default() -> Self {
20298 Self::DEFAULT.clone()
20299 }
20300}
20301impl MessageData for MISSION_REQUEST_PARTIAL_LIST_DATA {
20302 type Message = MavMessage;
20303 const ID: u32 = 37u32;
20304 const NAME: &'static str = "MISSION_REQUEST_PARTIAL_LIST";
20305 const EXTRA_CRC: u8 = 212u8;
20306 const ENCODED_LEN: usize = 7usize;
20307 fn deser(
20308 _version: MavlinkVersion,
20309 __input: &[u8],
20310 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20311 let avail_len = __input.len();
20312 let mut payload_buf = [0; Self::ENCODED_LEN];
20313 let mut buf = if avail_len < Self::ENCODED_LEN {
20314 payload_buf[0..avail_len].copy_from_slice(__input);
20315 Bytes::new(&payload_buf)
20316 } else {
20317 Bytes::new(__input)
20318 };
20319 let mut __struct = Self::default();
20320 __struct.start_index = buf.get_i16_le();
20321 __struct.end_index = buf.get_i16_le();
20322 __struct.target_system = buf.get_u8();
20323 __struct.target_component = buf.get_u8();
20324 let tmp = buf.get_u8();
20325 __struct.mission_type =
20326 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20327 enum_type: "MavMissionType",
20328 value: tmp as u64,
20329 })?;
20330 Ok(__struct)
20331 }
20332 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20333 let mut __tmp = BytesMut::new(bytes);
20334 #[allow(clippy::absurd_extreme_comparisons)]
20335 #[allow(unused_comparisons)]
20336 if __tmp.remaining() < Self::ENCODED_LEN {
20337 panic!(
20338 "buffer is too small (need {} bytes, but got {})",
20339 Self::ENCODED_LEN,
20340 __tmp.remaining(),
20341 )
20342 }
20343 __tmp.put_i16_le(self.start_index);
20344 __tmp.put_i16_le(self.end_index);
20345 __tmp.put_u8(self.target_system);
20346 __tmp.put_u8(self.target_component);
20347 if matches!(version, MavlinkVersion::V2) {
20348 __tmp.put_u8(self.mission_type as u8);
20349 let len = __tmp.len();
20350 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20351 } else {
20352 __tmp.len()
20353 }
20354 }
20355}
20356#[deprecated = " See `MAV_CMD_DO_SET_MISSION_CURRENT` (Deprecated since 2022-08)"]
20357#[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. Note that mission jump repeat counters are not reset (see MAV_CMD_DO_JUMP param2). This message may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this message must not trigger a switch to mission mode."]
20358#[doc = ""]
20359#[doc = "ID: 41"]
20360#[derive(Debug, Clone, PartialEq)]
20361#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20362#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20363#[cfg_attr(feature = "ts", derive(TS))]
20364#[cfg_attr(feature = "ts", ts(export))]
20365pub struct MISSION_SET_CURRENT_DATA {
20366 #[doc = "Sequence"]
20367 pub seq: u16,
20368 #[doc = "System ID"]
20369 pub target_system: u8,
20370 #[doc = "Component ID"]
20371 pub target_component: u8,
20372}
20373impl MISSION_SET_CURRENT_DATA {
20374 pub const ENCODED_LEN: usize = 4usize;
20375 pub const DEFAULT: Self = Self {
20376 seq: 0_u16,
20377 target_system: 0_u8,
20378 target_component: 0_u8,
20379 };
20380 #[cfg(feature = "arbitrary")]
20381 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20382 use arbitrary::{Arbitrary, Unstructured};
20383 let mut buf = [0u8; 1024];
20384 rng.fill_bytes(&mut buf);
20385 let mut unstructured = Unstructured::new(&buf);
20386 Self::arbitrary(&mut unstructured).unwrap_or_default()
20387 }
20388}
20389impl Default for MISSION_SET_CURRENT_DATA {
20390 fn default() -> Self {
20391 Self::DEFAULT.clone()
20392 }
20393}
20394impl MessageData for MISSION_SET_CURRENT_DATA {
20395 type Message = MavMessage;
20396 const ID: u32 = 41u32;
20397 const NAME: &'static str = "MISSION_SET_CURRENT";
20398 const EXTRA_CRC: u8 = 28u8;
20399 const ENCODED_LEN: usize = 4usize;
20400 fn deser(
20401 _version: MavlinkVersion,
20402 __input: &[u8],
20403 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20404 let avail_len = __input.len();
20405 let mut payload_buf = [0; Self::ENCODED_LEN];
20406 let mut buf = if avail_len < Self::ENCODED_LEN {
20407 payload_buf[0..avail_len].copy_from_slice(__input);
20408 Bytes::new(&payload_buf)
20409 } else {
20410 Bytes::new(__input)
20411 };
20412 let mut __struct = Self::default();
20413 __struct.seq = buf.get_u16_le();
20414 __struct.target_system = buf.get_u8();
20415 __struct.target_component = buf.get_u8();
20416 Ok(__struct)
20417 }
20418 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20419 let mut __tmp = BytesMut::new(bytes);
20420 #[allow(clippy::absurd_extreme_comparisons)]
20421 #[allow(unused_comparisons)]
20422 if __tmp.remaining() < Self::ENCODED_LEN {
20423 panic!(
20424 "buffer is too small (need {} bytes, but got {})",
20425 Self::ENCODED_LEN,
20426 __tmp.remaining(),
20427 )
20428 }
20429 __tmp.put_u16_le(self.seq);
20430 __tmp.put_u8(self.target_system);
20431 __tmp.put_u8(self.target_component);
20432 if matches!(version, MavlinkVersion::V2) {
20433 let len = __tmp.len();
20434 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20435 } else {
20436 __tmp.len()
20437 }
20438 }
20439}
20440#[doc = "This message is sent to the MAV to write a partial list. If start index == end index, only one item will be transmitted / updated. If the start index is NOT 0 and above the current list size, this request should be REJECTED!."]
20441#[doc = ""]
20442#[doc = "ID: 38"]
20443#[derive(Debug, Clone, PartialEq)]
20444#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20445#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20446#[cfg_attr(feature = "ts", derive(TS))]
20447#[cfg_attr(feature = "ts", ts(export))]
20448pub struct MISSION_WRITE_PARTIAL_LIST_DATA {
20449 #[doc = "Start index. Must be smaller / equal to the largest index of the current onboard list."]
20450 pub start_index: i16,
20451 #[doc = "End index, equal or greater than start index."]
20452 pub end_index: i16,
20453 #[doc = "System ID"]
20454 pub target_system: u8,
20455 #[doc = "Component ID"]
20456 pub target_component: u8,
20457 #[doc = "Mission type."]
20458 #[cfg_attr(feature = "serde", serde(default))]
20459 pub mission_type: MavMissionType,
20460}
20461impl MISSION_WRITE_PARTIAL_LIST_DATA {
20462 pub const ENCODED_LEN: usize = 7usize;
20463 pub const DEFAULT: Self = Self {
20464 start_index: 0_i16,
20465 end_index: 0_i16,
20466 target_system: 0_u8,
20467 target_component: 0_u8,
20468 mission_type: MavMissionType::DEFAULT,
20469 };
20470 #[cfg(feature = "arbitrary")]
20471 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20472 use arbitrary::{Arbitrary, Unstructured};
20473 let mut buf = [0u8; 1024];
20474 rng.fill_bytes(&mut buf);
20475 let mut unstructured = Unstructured::new(&buf);
20476 Self::arbitrary(&mut unstructured).unwrap_or_default()
20477 }
20478}
20479impl Default for MISSION_WRITE_PARTIAL_LIST_DATA {
20480 fn default() -> Self {
20481 Self::DEFAULT.clone()
20482 }
20483}
20484impl MessageData for MISSION_WRITE_PARTIAL_LIST_DATA {
20485 type Message = MavMessage;
20486 const ID: u32 = 38u32;
20487 const NAME: &'static str = "MISSION_WRITE_PARTIAL_LIST";
20488 const EXTRA_CRC: u8 = 9u8;
20489 const ENCODED_LEN: usize = 7usize;
20490 fn deser(
20491 _version: MavlinkVersion,
20492 __input: &[u8],
20493 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20494 let avail_len = __input.len();
20495 let mut payload_buf = [0; Self::ENCODED_LEN];
20496 let mut buf = if avail_len < Self::ENCODED_LEN {
20497 payload_buf[0..avail_len].copy_from_slice(__input);
20498 Bytes::new(&payload_buf)
20499 } else {
20500 Bytes::new(__input)
20501 };
20502 let mut __struct = Self::default();
20503 __struct.start_index = buf.get_i16_le();
20504 __struct.end_index = buf.get_i16_le();
20505 __struct.target_system = buf.get_u8();
20506 __struct.target_component = buf.get_u8();
20507 let tmp = buf.get_u8();
20508 __struct.mission_type =
20509 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20510 enum_type: "MavMissionType",
20511 value: tmp as u64,
20512 })?;
20513 Ok(__struct)
20514 }
20515 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20516 let mut __tmp = BytesMut::new(bytes);
20517 #[allow(clippy::absurd_extreme_comparisons)]
20518 #[allow(unused_comparisons)]
20519 if __tmp.remaining() < Self::ENCODED_LEN {
20520 panic!(
20521 "buffer is too small (need {} bytes, but got {})",
20522 Self::ENCODED_LEN,
20523 __tmp.remaining(),
20524 )
20525 }
20526 __tmp.put_i16_le(self.start_index);
20527 __tmp.put_i16_le(self.end_index);
20528 __tmp.put_u8(self.target_system);
20529 __tmp.put_u8(self.target_component);
20530 if matches!(version, MavlinkVersion::V2) {
20531 __tmp.put_u8(self.mission_type as u8);
20532 let len = __tmp.len();
20533 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20534 } else {
20535 __tmp.len()
20536 }
20537 }
20538}
20539#[deprecated = "This message is being superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
20540#[doc = "Orientation of a mount."]
20541#[doc = ""]
20542#[doc = "ID: 265"]
20543#[derive(Debug, Clone, PartialEq)]
20544#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20545#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20546#[cfg_attr(feature = "ts", derive(TS))]
20547#[cfg_attr(feature = "ts", ts(export))]
20548pub struct MOUNT_ORIENTATION_DATA {
20549 #[doc = "Timestamp (time since system boot)."]
20550 pub time_boot_ms: u32,
20551 #[doc = "Roll in global frame (set to NaN for invalid)."]
20552 pub roll: f32,
20553 #[doc = "Pitch in global frame (set to NaN for invalid)."]
20554 pub pitch: f32,
20555 #[doc = "Yaw relative to vehicle (set to NaN for invalid)."]
20556 pub yaw: f32,
20557 #[doc = "Yaw in absolute frame relative to Earth's North, north is 0 (set to NaN for invalid)."]
20558 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20559 pub yaw_absolute: f32,
20560}
20561impl MOUNT_ORIENTATION_DATA {
20562 pub const ENCODED_LEN: usize = 20usize;
20563 pub const DEFAULT: Self = Self {
20564 time_boot_ms: 0_u32,
20565 roll: 0.0_f32,
20566 pitch: 0.0_f32,
20567 yaw: 0.0_f32,
20568 yaw_absolute: 0.0_f32,
20569 };
20570 #[cfg(feature = "arbitrary")]
20571 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20572 use arbitrary::{Arbitrary, Unstructured};
20573 let mut buf = [0u8; 1024];
20574 rng.fill_bytes(&mut buf);
20575 let mut unstructured = Unstructured::new(&buf);
20576 Self::arbitrary(&mut unstructured).unwrap_or_default()
20577 }
20578}
20579impl Default for MOUNT_ORIENTATION_DATA {
20580 fn default() -> Self {
20581 Self::DEFAULT.clone()
20582 }
20583}
20584impl MessageData for MOUNT_ORIENTATION_DATA {
20585 type Message = MavMessage;
20586 const ID: u32 = 265u32;
20587 const NAME: &'static str = "MOUNT_ORIENTATION";
20588 const EXTRA_CRC: u8 = 26u8;
20589 const ENCODED_LEN: usize = 20usize;
20590 fn deser(
20591 _version: MavlinkVersion,
20592 __input: &[u8],
20593 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20594 let avail_len = __input.len();
20595 let mut payload_buf = [0; Self::ENCODED_LEN];
20596 let mut buf = if avail_len < Self::ENCODED_LEN {
20597 payload_buf[0..avail_len].copy_from_slice(__input);
20598 Bytes::new(&payload_buf)
20599 } else {
20600 Bytes::new(__input)
20601 };
20602 let mut __struct = Self::default();
20603 __struct.time_boot_ms = buf.get_u32_le();
20604 __struct.roll = buf.get_f32_le();
20605 __struct.pitch = buf.get_f32_le();
20606 __struct.yaw = buf.get_f32_le();
20607 __struct.yaw_absolute = buf.get_f32_le();
20608 Ok(__struct)
20609 }
20610 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20611 let mut __tmp = BytesMut::new(bytes);
20612 #[allow(clippy::absurd_extreme_comparisons)]
20613 #[allow(unused_comparisons)]
20614 if __tmp.remaining() < Self::ENCODED_LEN {
20615 panic!(
20616 "buffer is too small (need {} bytes, but got {})",
20617 Self::ENCODED_LEN,
20618 __tmp.remaining(),
20619 )
20620 }
20621 __tmp.put_u32_le(self.time_boot_ms);
20622 __tmp.put_f32_le(self.roll);
20623 __tmp.put_f32_le(self.pitch);
20624 __tmp.put_f32_le(self.yaw);
20625 if matches!(version, MavlinkVersion::V2) {
20626 __tmp.put_f32_le(self.yaw_absolute);
20627 let len = __tmp.len();
20628 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20629 } else {
20630 __tmp.len()
20631 }
20632 }
20633}
20634#[doc = "Send a key-value pair as float. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
20635#[doc = ""]
20636#[doc = "ID: 251"]
20637#[derive(Debug, Clone, PartialEq)]
20638#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20639#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20640#[cfg_attr(feature = "ts", derive(TS))]
20641#[cfg_attr(feature = "ts", ts(export))]
20642pub struct NAMED_VALUE_FLOAT_DATA {
20643 #[doc = "Timestamp (time since system boot)."]
20644 pub time_boot_ms: u32,
20645 #[doc = "Floating point value"]
20646 pub value: f32,
20647 #[doc = "Name of the debug variable"]
20648 #[cfg_attr(feature = "ts", ts(type = "string"))]
20649 pub name: CharArray<10>,
20650}
20651impl NAMED_VALUE_FLOAT_DATA {
20652 pub const ENCODED_LEN: usize = 18usize;
20653 pub const DEFAULT: Self = Self {
20654 time_boot_ms: 0_u32,
20655 value: 0.0_f32,
20656 name: CharArray::new([0_u8; 10usize]),
20657 };
20658 #[cfg(feature = "arbitrary")]
20659 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20660 use arbitrary::{Arbitrary, Unstructured};
20661 let mut buf = [0u8; 1024];
20662 rng.fill_bytes(&mut buf);
20663 let mut unstructured = Unstructured::new(&buf);
20664 Self::arbitrary(&mut unstructured).unwrap_or_default()
20665 }
20666}
20667impl Default for NAMED_VALUE_FLOAT_DATA {
20668 fn default() -> Self {
20669 Self::DEFAULT.clone()
20670 }
20671}
20672impl MessageData for NAMED_VALUE_FLOAT_DATA {
20673 type Message = MavMessage;
20674 const ID: u32 = 251u32;
20675 const NAME: &'static str = "NAMED_VALUE_FLOAT";
20676 const EXTRA_CRC: u8 = 170u8;
20677 const ENCODED_LEN: usize = 18usize;
20678 fn deser(
20679 _version: MavlinkVersion,
20680 __input: &[u8],
20681 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20682 let avail_len = __input.len();
20683 let mut payload_buf = [0; Self::ENCODED_LEN];
20684 let mut buf = if avail_len < Self::ENCODED_LEN {
20685 payload_buf[0..avail_len].copy_from_slice(__input);
20686 Bytes::new(&payload_buf)
20687 } else {
20688 Bytes::new(__input)
20689 };
20690 let mut __struct = Self::default();
20691 __struct.time_boot_ms = buf.get_u32_le();
20692 __struct.value = buf.get_f32_le();
20693 let mut tmp = [0_u8; 10usize];
20694 for v in &mut tmp {
20695 *v = buf.get_u8();
20696 }
20697 __struct.name = CharArray::new(tmp);
20698 Ok(__struct)
20699 }
20700 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20701 let mut __tmp = BytesMut::new(bytes);
20702 #[allow(clippy::absurd_extreme_comparisons)]
20703 #[allow(unused_comparisons)]
20704 if __tmp.remaining() < Self::ENCODED_LEN {
20705 panic!(
20706 "buffer is too small (need {} bytes, but got {})",
20707 Self::ENCODED_LEN,
20708 __tmp.remaining(),
20709 )
20710 }
20711 __tmp.put_u32_le(self.time_boot_ms);
20712 __tmp.put_f32_le(self.value);
20713 for val in &self.name {
20714 __tmp.put_u8(*val);
20715 }
20716 if matches!(version, MavlinkVersion::V2) {
20717 let len = __tmp.len();
20718 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20719 } else {
20720 __tmp.len()
20721 }
20722 }
20723}
20724#[doc = "Send a key-value pair as integer. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
20725#[doc = ""]
20726#[doc = "ID: 252"]
20727#[derive(Debug, Clone, PartialEq)]
20728#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20729#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20730#[cfg_attr(feature = "ts", derive(TS))]
20731#[cfg_attr(feature = "ts", ts(export))]
20732pub struct NAMED_VALUE_INT_DATA {
20733 #[doc = "Timestamp (time since system boot)."]
20734 pub time_boot_ms: u32,
20735 #[doc = "Signed integer value"]
20736 pub value: i32,
20737 #[doc = "Name of the debug variable"]
20738 #[cfg_attr(feature = "ts", ts(type = "string"))]
20739 pub name: CharArray<10>,
20740}
20741impl NAMED_VALUE_INT_DATA {
20742 pub const ENCODED_LEN: usize = 18usize;
20743 pub const DEFAULT: Self = Self {
20744 time_boot_ms: 0_u32,
20745 value: 0_i32,
20746 name: CharArray::new([0_u8; 10usize]),
20747 };
20748 #[cfg(feature = "arbitrary")]
20749 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20750 use arbitrary::{Arbitrary, Unstructured};
20751 let mut buf = [0u8; 1024];
20752 rng.fill_bytes(&mut buf);
20753 let mut unstructured = Unstructured::new(&buf);
20754 Self::arbitrary(&mut unstructured).unwrap_or_default()
20755 }
20756}
20757impl Default for NAMED_VALUE_INT_DATA {
20758 fn default() -> Self {
20759 Self::DEFAULT.clone()
20760 }
20761}
20762impl MessageData for NAMED_VALUE_INT_DATA {
20763 type Message = MavMessage;
20764 const ID: u32 = 252u32;
20765 const NAME: &'static str = "NAMED_VALUE_INT";
20766 const EXTRA_CRC: u8 = 44u8;
20767 const ENCODED_LEN: usize = 18usize;
20768 fn deser(
20769 _version: MavlinkVersion,
20770 __input: &[u8],
20771 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20772 let avail_len = __input.len();
20773 let mut payload_buf = [0; Self::ENCODED_LEN];
20774 let mut buf = if avail_len < Self::ENCODED_LEN {
20775 payload_buf[0..avail_len].copy_from_slice(__input);
20776 Bytes::new(&payload_buf)
20777 } else {
20778 Bytes::new(__input)
20779 };
20780 let mut __struct = Self::default();
20781 __struct.time_boot_ms = buf.get_u32_le();
20782 __struct.value = buf.get_i32_le();
20783 let mut tmp = [0_u8; 10usize];
20784 for v in &mut tmp {
20785 *v = buf.get_u8();
20786 }
20787 __struct.name = CharArray::new(tmp);
20788 Ok(__struct)
20789 }
20790 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20791 let mut __tmp = BytesMut::new(bytes);
20792 #[allow(clippy::absurd_extreme_comparisons)]
20793 #[allow(unused_comparisons)]
20794 if __tmp.remaining() < Self::ENCODED_LEN {
20795 panic!(
20796 "buffer is too small (need {} bytes, but got {})",
20797 Self::ENCODED_LEN,
20798 __tmp.remaining(),
20799 )
20800 }
20801 __tmp.put_u32_le(self.time_boot_ms);
20802 __tmp.put_i32_le(self.value);
20803 for val in &self.name {
20804 __tmp.put_u8(*val);
20805 }
20806 if matches!(version, MavlinkVersion::V2) {
20807 let len = __tmp.len();
20808 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20809 } else {
20810 __tmp.len()
20811 }
20812 }
20813}
20814#[doc = "The state of the navigation and position controller."]
20815#[doc = ""]
20816#[doc = "ID: 62"]
20817#[derive(Debug, Clone, PartialEq)]
20818#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20819#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20820#[cfg_attr(feature = "ts", derive(TS))]
20821#[cfg_attr(feature = "ts", ts(export))]
20822pub struct NAV_CONTROLLER_OUTPUT_DATA {
20823 #[doc = "Current desired roll"]
20824 pub nav_roll: f32,
20825 #[doc = "Current desired pitch"]
20826 pub nav_pitch: f32,
20827 #[doc = "Current altitude error"]
20828 pub alt_error: f32,
20829 #[doc = "Current airspeed error"]
20830 pub aspd_error: f32,
20831 #[doc = "Current crosstrack error on x-y plane"]
20832 pub xtrack_error: f32,
20833 #[doc = "Current desired heading"]
20834 pub nav_bearing: i16,
20835 #[doc = "Bearing to current waypoint/target"]
20836 pub target_bearing: i16,
20837 #[doc = "Distance to active waypoint"]
20838 pub wp_dist: u16,
20839}
20840impl NAV_CONTROLLER_OUTPUT_DATA {
20841 pub const ENCODED_LEN: usize = 26usize;
20842 pub const DEFAULT: Self = Self {
20843 nav_roll: 0.0_f32,
20844 nav_pitch: 0.0_f32,
20845 alt_error: 0.0_f32,
20846 aspd_error: 0.0_f32,
20847 xtrack_error: 0.0_f32,
20848 nav_bearing: 0_i16,
20849 target_bearing: 0_i16,
20850 wp_dist: 0_u16,
20851 };
20852 #[cfg(feature = "arbitrary")]
20853 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20854 use arbitrary::{Arbitrary, Unstructured};
20855 let mut buf = [0u8; 1024];
20856 rng.fill_bytes(&mut buf);
20857 let mut unstructured = Unstructured::new(&buf);
20858 Self::arbitrary(&mut unstructured).unwrap_or_default()
20859 }
20860}
20861impl Default for NAV_CONTROLLER_OUTPUT_DATA {
20862 fn default() -> Self {
20863 Self::DEFAULT.clone()
20864 }
20865}
20866impl MessageData for NAV_CONTROLLER_OUTPUT_DATA {
20867 type Message = MavMessage;
20868 const ID: u32 = 62u32;
20869 const NAME: &'static str = "NAV_CONTROLLER_OUTPUT";
20870 const EXTRA_CRC: u8 = 183u8;
20871 const ENCODED_LEN: usize = 26usize;
20872 fn deser(
20873 _version: MavlinkVersion,
20874 __input: &[u8],
20875 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20876 let avail_len = __input.len();
20877 let mut payload_buf = [0; Self::ENCODED_LEN];
20878 let mut buf = if avail_len < Self::ENCODED_LEN {
20879 payload_buf[0..avail_len].copy_from_slice(__input);
20880 Bytes::new(&payload_buf)
20881 } else {
20882 Bytes::new(__input)
20883 };
20884 let mut __struct = Self::default();
20885 __struct.nav_roll = buf.get_f32_le();
20886 __struct.nav_pitch = buf.get_f32_le();
20887 __struct.alt_error = buf.get_f32_le();
20888 __struct.aspd_error = buf.get_f32_le();
20889 __struct.xtrack_error = buf.get_f32_le();
20890 __struct.nav_bearing = buf.get_i16_le();
20891 __struct.target_bearing = buf.get_i16_le();
20892 __struct.wp_dist = buf.get_u16_le();
20893 Ok(__struct)
20894 }
20895 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20896 let mut __tmp = BytesMut::new(bytes);
20897 #[allow(clippy::absurd_extreme_comparisons)]
20898 #[allow(unused_comparisons)]
20899 if __tmp.remaining() < Self::ENCODED_LEN {
20900 panic!(
20901 "buffer is too small (need {} bytes, but got {})",
20902 Self::ENCODED_LEN,
20903 __tmp.remaining(),
20904 )
20905 }
20906 __tmp.put_f32_le(self.nav_roll);
20907 __tmp.put_f32_le(self.nav_pitch);
20908 __tmp.put_f32_le(self.alt_error);
20909 __tmp.put_f32_le(self.aspd_error);
20910 __tmp.put_f32_le(self.xtrack_error);
20911 __tmp.put_i16_le(self.nav_bearing);
20912 __tmp.put_i16_le(self.target_bearing);
20913 __tmp.put_u16_le(self.wp_dist);
20914 if matches!(version, MavlinkVersion::V2) {
20915 let len = __tmp.len();
20916 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20917 } else {
20918 __tmp.len()
20919 }
20920 }
20921}
20922#[doc = "Accelerometer and Gyro biases from the navigation filter."]
20923#[doc = ""]
20924#[doc = "ID: 220"]
20925#[derive(Debug, Clone, PartialEq)]
20926#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20927#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20928#[cfg_attr(feature = "ts", derive(TS))]
20929#[cfg_attr(feature = "ts", ts(export))]
20930pub struct NAV_FILTER_BIAS_DATA {
20931 #[doc = "Timestamp (microseconds)"]
20932 pub usec: u64,
20933 #[doc = "b_f[0]"]
20934 pub accel_0: f32,
20935 #[doc = "b_f[1]"]
20936 pub accel_1: f32,
20937 #[doc = "b_f[2]"]
20938 pub accel_2: f32,
20939 #[doc = "b_f[0]"]
20940 pub gyro_0: f32,
20941 #[doc = "b_f[1]"]
20942 pub gyro_1: f32,
20943 #[doc = "b_f[2]"]
20944 pub gyro_2: f32,
20945}
20946impl NAV_FILTER_BIAS_DATA {
20947 pub const ENCODED_LEN: usize = 32usize;
20948 pub const DEFAULT: Self = Self {
20949 usec: 0_u64,
20950 accel_0: 0.0_f32,
20951 accel_1: 0.0_f32,
20952 accel_2: 0.0_f32,
20953 gyro_0: 0.0_f32,
20954 gyro_1: 0.0_f32,
20955 gyro_2: 0.0_f32,
20956 };
20957 #[cfg(feature = "arbitrary")]
20958 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20959 use arbitrary::{Arbitrary, Unstructured};
20960 let mut buf = [0u8; 1024];
20961 rng.fill_bytes(&mut buf);
20962 let mut unstructured = Unstructured::new(&buf);
20963 Self::arbitrary(&mut unstructured).unwrap_or_default()
20964 }
20965}
20966impl Default for NAV_FILTER_BIAS_DATA {
20967 fn default() -> Self {
20968 Self::DEFAULT.clone()
20969 }
20970}
20971impl MessageData for NAV_FILTER_BIAS_DATA {
20972 type Message = MavMessage;
20973 const ID: u32 = 220u32;
20974 const NAME: &'static str = "NAV_FILTER_BIAS";
20975 const EXTRA_CRC: u8 = 34u8;
20976 const ENCODED_LEN: usize = 32usize;
20977 fn deser(
20978 _version: MavlinkVersion,
20979 __input: &[u8],
20980 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20981 let avail_len = __input.len();
20982 let mut payload_buf = [0; Self::ENCODED_LEN];
20983 let mut buf = if avail_len < Self::ENCODED_LEN {
20984 payload_buf[0..avail_len].copy_from_slice(__input);
20985 Bytes::new(&payload_buf)
20986 } else {
20987 Bytes::new(__input)
20988 };
20989 let mut __struct = Self::default();
20990 __struct.usec = buf.get_u64_le();
20991 __struct.accel_0 = buf.get_f32_le();
20992 __struct.accel_1 = buf.get_f32_le();
20993 __struct.accel_2 = buf.get_f32_le();
20994 __struct.gyro_0 = buf.get_f32_le();
20995 __struct.gyro_1 = buf.get_f32_le();
20996 __struct.gyro_2 = buf.get_f32_le();
20997 Ok(__struct)
20998 }
20999 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21000 let mut __tmp = BytesMut::new(bytes);
21001 #[allow(clippy::absurd_extreme_comparisons)]
21002 #[allow(unused_comparisons)]
21003 if __tmp.remaining() < Self::ENCODED_LEN {
21004 panic!(
21005 "buffer is too small (need {} bytes, but got {})",
21006 Self::ENCODED_LEN,
21007 __tmp.remaining(),
21008 )
21009 }
21010 __tmp.put_u64_le(self.usec);
21011 __tmp.put_f32_le(self.accel_0);
21012 __tmp.put_f32_le(self.accel_1);
21013 __tmp.put_f32_le(self.accel_2);
21014 __tmp.put_f32_le(self.gyro_0);
21015 __tmp.put_f32_le(self.gyro_1);
21016 __tmp.put_f32_le(self.gyro_2);
21017 if matches!(version, MavlinkVersion::V2) {
21018 let len = __tmp.len();
21019 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21020 } else {
21021 __tmp.len()
21022 }
21023 }
21024}
21025#[doc = "Obstacle distances in front of the sensor, starting from the left in increment degrees to the right."]
21026#[doc = ""]
21027#[doc = "ID: 330"]
21028#[derive(Debug, Clone, PartialEq)]
21029#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21030#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21031#[cfg_attr(feature = "ts", derive(TS))]
21032#[cfg_attr(feature = "ts", ts(export))]
21033pub struct OBSTACLE_DISTANCE_DATA {
21034 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
21035 pub time_usec: u64,
21036 #[doc = "Distance of obstacles around the vehicle with index 0 corresponding to north + angle_offset, unless otherwise specified in the frame. A value of 0 is valid and means that the obstacle is practically touching the sensor. A value of max_distance +1 means no obstacle is present. A value of UINT16_MAX for unknown/not used. In a array element, one unit corresponds to 1cm."]
21037 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21038 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21039 pub distances: [u16; 72],
21040 #[doc = "Minimum distance the sensor can measure."]
21041 pub min_distance: u16,
21042 #[doc = "Maximum distance the sensor can measure."]
21043 pub max_distance: u16,
21044 #[doc = "Class id of the distance sensor type."]
21045 pub sensor_type: MavDistanceSensor,
21046 #[doc = "Angular width in degrees of each array element. Increment direction is clockwise. This field is ignored if increment_f is non-zero."]
21047 pub increment: u8,
21048 #[doc = "Angular width in degrees of each array element as a float. If non-zero then this value is used instead of the uint8_t increment field. Positive is clockwise direction, negative is counter-clockwise."]
21049 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21050 pub increment_f: f32,
21051 #[doc = "Relative angle offset of the 0-index element in the distances array. Value of 0 corresponds to forward. Positive is clockwise direction, negative is counter-clockwise."]
21052 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21053 pub angle_offset: f32,
21054 #[doc = "Coordinate frame of reference for the yaw rotation and offset of the sensor data. Defaults to MAV_FRAME_GLOBAL, which is north aligned. For body-mounted sensors use MAV_FRAME_BODY_FRD, which is vehicle front aligned."]
21055 #[cfg_attr(feature = "serde", serde(default))]
21056 pub frame: MavFrame,
21057}
21058impl OBSTACLE_DISTANCE_DATA {
21059 pub const ENCODED_LEN: usize = 167usize;
21060 pub const DEFAULT: Self = Self {
21061 time_usec: 0_u64,
21062 distances: [0_u16; 72usize],
21063 min_distance: 0_u16,
21064 max_distance: 0_u16,
21065 sensor_type: MavDistanceSensor::DEFAULT,
21066 increment: 0_u8,
21067 increment_f: 0.0_f32,
21068 angle_offset: 0.0_f32,
21069 frame: MavFrame::DEFAULT,
21070 };
21071 #[cfg(feature = "arbitrary")]
21072 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21073 use arbitrary::{Arbitrary, Unstructured};
21074 let mut buf = [0u8; 1024];
21075 rng.fill_bytes(&mut buf);
21076 let mut unstructured = Unstructured::new(&buf);
21077 Self::arbitrary(&mut unstructured).unwrap_or_default()
21078 }
21079}
21080impl Default for OBSTACLE_DISTANCE_DATA {
21081 fn default() -> Self {
21082 Self::DEFAULT.clone()
21083 }
21084}
21085impl MessageData for OBSTACLE_DISTANCE_DATA {
21086 type Message = MavMessage;
21087 const ID: u32 = 330u32;
21088 const NAME: &'static str = "OBSTACLE_DISTANCE";
21089 const EXTRA_CRC: u8 = 23u8;
21090 const ENCODED_LEN: usize = 167usize;
21091 fn deser(
21092 _version: MavlinkVersion,
21093 __input: &[u8],
21094 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21095 let avail_len = __input.len();
21096 let mut payload_buf = [0; Self::ENCODED_LEN];
21097 let mut buf = if avail_len < Self::ENCODED_LEN {
21098 payload_buf[0..avail_len].copy_from_slice(__input);
21099 Bytes::new(&payload_buf)
21100 } else {
21101 Bytes::new(__input)
21102 };
21103 let mut __struct = Self::default();
21104 __struct.time_usec = buf.get_u64_le();
21105 for v in &mut __struct.distances {
21106 let val = buf.get_u16_le();
21107 *v = val;
21108 }
21109 __struct.min_distance = buf.get_u16_le();
21110 __struct.max_distance = buf.get_u16_le();
21111 let tmp = buf.get_u8();
21112 __struct.sensor_type =
21113 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21114 enum_type: "MavDistanceSensor",
21115 value: tmp as u64,
21116 })?;
21117 __struct.increment = buf.get_u8();
21118 __struct.increment_f = buf.get_f32_le();
21119 __struct.angle_offset = buf.get_f32_le();
21120 let tmp = buf.get_u8();
21121 __struct.frame =
21122 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21123 enum_type: "MavFrame",
21124 value: tmp as u64,
21125 })?;
21126 Ok(__struct)
21127 }
21128 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21129 let mut __tmp = BytesMut::new(bytes);
21130 #[allow(clippy::absurd_extreme_comparisons)]
21131 #[allow(unused_comparisons)]
21132 if __tmp.remaining() < Self::ENCODED_LEN {
21133 panic!(
21134 "buffer is too small (need {} bytes, but got {})",
21135 Self::ENCODED_LEN,
21136 __tmp.remaining(),
21137 )
21138 }
21139 __tmp.put_u64_le(self.time_usec);
21140 for val in &self.distances {
21141 __tmp.put_u16_le(*val);
21142 }
21143 __tmp.put_u16_le(self.min_distance);
21144 __tmp.put_u16_le(self.max_distance);
21145 __tmp.put_u8(self.sensor_type as u8);
21146 __tmp.put_u8(self.increment);
21147 if matches!(version, MavlinkVersion::V2) {
21148 __tmp.put_f32_le(self.increment_f);
21149 __tmp.put_f32_le(self.angle_offset);
21150 __tmp.put_u8(self.frame as u8);
21151 let len = __tmp.len();
21152 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21153 } else {
21154 __tmp.len()
21155 }
21156 }
21157}
21158#[doc = "Odometry message to communicate odometry information with an external interface. Fits ROS REP 147 standard for aerial vehicles (<http://www.ros.org/reps/rep-0147.html>)."]
21159#[doc = ""]
21160#[doc = "ID: 331"]
21161#[derive(Debug, Clone, PartialEq)]
21162#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21163#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21164#[cfg_attr(feature = "ts", derive(TS))]
21165#[cfg_attr(feature = "ts", ts(export))]
21166pub struct ODOMETRY_DATA {
21167 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
21168 pub time_usec: u64,
21169 #[doc = "X Position"]
21170 pub x: f32,
21171 #[doc = "Y Position"]
21172 pub y: f32,
21173 #[doc = "Z Position"]
21174 pub z: f32,
21175 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)"]
21176 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21177 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21178 pub q: [f32; 4],
21179 #[doc = "X linear speed"]
21180 pub vx: f32,
21181 #[doc = "Y linear speed"]
21182 pub vy: f32,
21183 #[doc = "Z linear speed"]
21184 pub vz: f32,
21185 #[doc = "Roll angular speed"]
21186 pub rollspeed: f32,
21187 #[doc = "Pitch angular speed"]
21188 pub pitchspeed: f32,
21189 #[doc = "Yaw angular speed"]
21190 pub yawspeed: f32,
21191 #[doc = "Row-major representation of a 6x6 pose cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
21192 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21193 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21194 pub pose_covariance: [f32; 21],
21195 #[doc = "Row-major representation of a 6x6 velocity cross-covariance matrix upper right triangle (states: vx, vy, vz, rollspeed, pitchspeed, yawspeed; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
21196 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21197 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21198 pub velocity_covariance: [f32; 21],
21199 #[doc = "Coordinate frame of reference for the pose data."]
21200 pub frame_id: MavFrame,
21201 #[doc = "Coordinate frame of reference for the velocity in free space (twist) data."]
21202 pub child_frame_id: MavFrame,
21203 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
21204 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21205 pub reset_counter: u8,
21206 #[doc = "Type of estimator that is providing the odometry."]
21207 #[cfg_attr(feature = "serde", serde(default))]
21208 pub estimator_type: MavEstimatorType,
21209 #[doc = "Optional odometry quality metric as a percentage. -1 = odometry has failed, 0 = unknown/unset quality, 1 = worst quality, 100 = best quality"]
21210 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21211 pub quality: i8,
21212}
21213impl ODOMETRY_DATA {
21214 pub const ENCODED_LEN: usize = 233usize;
21215 pub const DEFAULT: Self = Self {
21216 time_usec: 0_u64,
21217 x: 0.0_f32,
21218 y: 0.0_f32,
21219 z: 0.0_f32,
21220 q: [0.0_f32; 4usize],
21221 vx: 0.0_f32,
21222 vy: 0.0_f32,
21223 vz: 0.0_f32,
21224 rollspeed: 0.0_f32,
21225 pitchspeed: 0.0_f32,
21226 yawspeed: 0.0_f32,
21227 pose_covariance: [0.0_f32; 21usize],
21228 velocity_covariance: [0.0_f32; 21usize],
21229 frame_id: MavFrame::DEFAULT,
21230 child_frame_id: MavFrame::DEFAULT,
21231 reset_counter: 0_u8,
21232 estimator_type: MavEstimatorType::DEFAULT,
21233 quality: 0_i8,
21234 };
21235 #[cfg(feature = "arbitrary")]
21236 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21237 use arbitrary::{Arbitrary, Unstructured};
21238 let mut buf = [0u8; 1024];
21239 rng.fill_bytes(&mut buf);
21240 let mut unstructured = Unstructured::new(&buf);
21241 Self::arbitrary(&mut unstructured).unwrap_or_default()
21242 }
21243}
21244impl Default for ODOMETRY_DATA {
21245 fn default() -> Self {
21246 Self::DEFAULT.clone()
21247 }
21248}
21249impl MessageData for ODOMETRY_DATA {
21250 type Message = MavMessage;
21251 const ID: u32 = 331u32;
21252 const NAME: &'static str = "ODOMETRY";
21253 const EXTRA_CRC: u8 = 91u8;
21254 const ENCODED_LEN: usize = 233usize;
21255 fn deser(
21256 _version: MavlinkVersion,
21257 __input: &[u8],
21258 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21259 let avail_len = __input.len();
21260 let mut payload_buf = [0; Self::ENCODED_LEN];
21261 let mut buf = if avail_len < Self::ENCODED_LEN {
21262 payload_buf[0..avail_len].copy_from_slice(__input);
21263 Bytes::new(&payload_buf)
21264 } else {
21265 Bytes::new(__input)
21266 };
21267 let mut __struct = Self::default();
21268 __struct.time_usec = buf.get_u64_le();
21269 __struct.x = buf.get_f32_le();
21270 __struct.y = buf.get_f32_le();
21271 __struct.z = buf.get_f32_le();
21272 for v in &mut __struct.q {
21273 let val = buf.get_f32_le();
21274 *v = val;
21275 }
21276 __struct.vx = buf.get_f32_le();
21277 __struct.vy = buf.get_f32_le();
21278 __struct.vz = buf.get_f32_le();
21279 __struct.rollspeed = buf.get_f32_le();
21280 __struct.pitchspeed = buf.get_f32_le();
21281 __struct.yawspeed = buf.get_f32_le();
21282 for v in &mut __struct.pose_covariance {
21283 let val = buf.get_f32_le();
21284 *v = val;
21285 }
21286 for v in &mut __struct.velocity_covariance {
21287 let val = buf.get_f32_le();
21288 *v = val;
21289 }
21290 let tmp = buf.get_u8();
21291 __struct.frame_id =
21292 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21293 enum_type: "MavFrame",
21294 value: tmp as u64,
21295 })?;
21296 let tmp = buf.get_u8();
21297 __struct.child_frame_id =
21298 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21299 enum_type: "MavFrame",
21300 value: tmp as u64,
21301 })?;
21302 __struct.reset_counter = buf.get_u8();
21303 let tmp = buf.get_u8();
21304 __struct.estimator_type =
21305 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21306 enum_type: "MavEstimatorType",
21307 value: tmp as u64,
21308 })?;
21309 __struct.quality = buf.get_i8();
21310 Ok(__struct)
21311 }
21312 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21313 let mut __tmp = BytesMut::new(bytes);
21314 #[allow(clippy::absurd_extreme_comparisons)]
21315 #[allow(unused_comparisons)]
21316 if __tmp.remaining() < Self::ENCODED_LEN {
21317 panic!(
21318 "buffer is too small (need {} bytes, but got {})",
21319 Self::ENCODED_LEN,
21320 __tmp.remaining(),
21321 )
21322 }
21323 __tmp.put_u64_le(self.time_usec);
21324 __tmp.put_f32_le(self.x);
21325 __tmp.put_f32_le(self.y);
21326 __tmp.put_f32_le(self.z);
21327 for val in &self.q {
21328 __tmp.put_f32_le(*val);
21329 }
21330 __tmp.put_f32_le(self.vx);
21331 __tmp.put_f32_le(self.vy);
21332 __tmp.put_f32_le(self.vz);
21333 __tmp.put_f32_le(self.rollspeed);
21334 __tmp.put_f32_le(self.pitchspeed);
21335 __tmp.put_f32_le(self.yawspeed);
21336 for val in &self.pose_covariance {
21337 __tmp.put_f32_le(*val);
21338 }
21339 for val in &self.velocity_covariance {
21340 __tmp.put_f32_le(*val);
21341 }
21342 __tmp.put_u8(self.frame_id as u8);
21343 __tmp.put_u8(self.child_frame_id as u8);
21344 if matches!(version, MavlinkVersion::V2) {
21345 __tmp.put_u8(self.reset_counter);
21346 __tmp.put_u8(self.estimator_type as u8);
21347 __tmp.put_i8(self.quality);
21348 let len = __tmp.len();
21349 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21350 } else {
21351 __tmp.len()
21352 }
21353 }
21354}
21355#[doc = "Hardware status sent by an onboard computer."]
21356#[doc = ""]
21357#[doc = "ID: 390"]
21358#[derive(Debug, Clone, PartialEq)]
21359#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21360#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21361#[cfg_attr(feature = "ts", derive(TS))]
21362#[cfg_attr(feature = "ts", ts(export))]
21363pub struct ONBOARD_COMPUTER_STATUS_DATA {
21364 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
21365 pub time_usec: u64,
21366 #[doc = "Time since system boot."]
21367 pub uptime: u32,
21368 #[doc = "Amount of used RAM on the component system. A value of UINT32_MAX implies the field is unused."]
21369 pub ram_usage: u32,
21370 #[doc = "Total amount of RAM on the component system. A value of UINT32_MAX implies the field is unused."]
21371 pub ram_total: u32,
21372 #[doc = "Storage type: 0: HDD, 1: SSD, 2: EMMC, 3: SD card (non-removable), 4: SD card (removable). A value of UINT32_MAX implies the field is unused."]
21373 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21374 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21375 pub storage_type: [u32; 4],
21376 #[doc = "Amount of used storage space on the component system. A value of UINT32_MAX implies the field is unused."]
21377 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21378 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21379 pub storage_usage: [u32; 4],
21380 #[doc = "Total amount of storage space on the component system. A value of UINT32_MAX implies the field is unused."]
21381 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21382 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21383 pub storage_total: [u32; 4],
21384 #[doc = "Link type: 0-9: UART, 10-19: Wired network, 20-29: Wifi, 30-39: Point-to-point proprietary, 40-49: Mesh proprietary"]
21385 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21386 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21387 pub link_type: [u32; 6],
21388 #[doc = "Network traffic from the component system. A value of UINT32_MAX implies the field is unused."]
21389 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21390 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21391 pub link_tx_rate: [u32; 6],
21392 #[doc = "Network traffic to the component system. A value of UINT32_MAX implies the field is unused."]
21393 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21394 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21395 pub link_rx_rate: [u32; 6],
21396 #[doc = "Network capacity from the component system. A value of UINT32_MAX implies the field is unused."]
21397 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21398 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21399 pub link_tx_max: [u32; 6],
21400 #[doc = "Network capacity to the component system. A value of UINT32_MAX implies the field is unused."]
21401 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21402 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21403 pub link_rx_max: [u32; 6],
21404 #[doc = "Fan speeds. A value of INT16_MAX implies the field is unused."]
21405 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21406 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21407 pub fan_speed: [i16; 4],
21408 #[doc = "Type of the onboard computer: 0: Mission computer primary, 1: Mission computer backup 1, 2: Mission computer backup 2, 3: Compute node, 4-5: Compute spares, 6-9: Payload computers."]
21409 pub mavtype: u8,
21410 #[doc = "CPU usage on the component in percent (100 - idle). A value of UINT8_MAX implies the field is unused."]
21411 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21412 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21413 pub cpu_cores: [u8; 8],
21414 #[doc = "Combined CPU usage as the last 10 slices of 100 MS (a histogram). This allows to identify spikes in load that max out the system, but only for a short amount of time. A value of UINT8_MAX implies the field is unused."]
21415 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21416 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21417 pub cpu_combined: [u8; 10],
21418 #[doc = "GPU usage on the component in percent (100 - idle). A value of UINT8_MAX implies the field is unused."]
21419 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21420 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21421 pub gpu_cores: [u8; 4],
21422 #[doc = "Combined GPU usage as the last 10 slices of 100 MS (a histogram). This allows to identify spikes in load that max out the system, but only for a short amount of time. A value of UINT8_MAX implies the field is unused."]
21423 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21424 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21425 pub gpu_combined: [u8; 10],
21426 #[doc = "Temperature of the board. A value of INT8_MAX implies the field is unused."]
21427 pub temperature_board: i8,
21428 #[doc = "Temperature of the CPU core. A value of INT8_MAX implies the field is unused."]
21429 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21430 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21431 pub temperature_core: [i8; 8],
21432}
21433impl ONBOARD_COMPUTER_STATUS_DATA {
21434 pub const ENCODED_LEN: usize = 238usize;
21435 pub const DEFAULT: Self = Self {
21436 time_usec: 0_u64,
21437 uptime: 0_u32,
21438 ram_usage: 0_u32,
21439 ram_total: 0_u32,
21440 storage_type: [0_u32; 4usize],
21441 storage_usage: [0_u32; 4usize],
21442 storage_total: [0_u32; 4usize],
21443 link_type: [0_u32; 6usize],
21444 link_tx_rate: [0_u32; 6usize],
21445 link_rx_rate: [0_u32; 6usize],
21446 link_tx_max: [0_u32; 6usize],
21447 link_rx_max: [0_u32; 6usize],
21448 fan_speed: [0_i16; 4usize],
21449 mavtype: 0_u8,
21450 cpu_cores: [0_u8; 8usize],
21451 cpu_combined: [0_u8; 10usize],
21452 gpu_cores: [0_u8; 4usize],
21453 gpu_combined: [0_u8; 10usize],
21454 temperature_board: 0_i8,
21455 temperature_core: [0_i8; 8usize],
21456 };
21457 #[cfg(feature = "arbitrary")]
21458 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21459 use arbitrary::{Arbitrary, Unstructured};
21460 let mut buf = [0u8; 1024];
21461 rng.fill_bytes(&mut buf);
21462 let mut unstructured = Unstructured::new(&buf);
21463 Self::arbitrary(&mut unstructured).unwrap_or_default()
21464 }
21465}
21466impl Default for ONBOARD_COMPUTER_STATUS_DATA {
21467 fn default() -> Self {
21468 Self::DEFAULT.clone()
21469 }
21470}
21471impl MessageData for ONBOARD_COMPUTER_STATUS_DATA {
21472 type Message = MavMessage;
21473 const ID: u32 = 390u32;
21474 const NAME: &'static str = "ONBOARD_COMPUTER_STATUS";
21475 const EXTRA_CRC: u8 = 156u8;
21476 const ENCODED_LEN: usize = 238usize;
21477 fn deser(
21478 _version: MavlinkVersion,
21479 __input: &[u8],
21480 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21481 let avail_len = __input.len();
21482 let mut payload_buf = [0; Self::ENCODED_LEN];
21483 let mut buf = if avail_len < Self::ENCODED_LEN {
21484 payload_buf[0..avail_len].copy_from_slice(__input);
21485 Bytes::new(&payload_buf)
21486 } else {
21487 Bytes::new(__input)
21488 };
21489 let mut __struct = Self::default();
21490 __struct.time_usec = buf.get_u64_le();
21491 __struct.uptime = buf.get_u32_le();
21492 __struct.ram_usage = buf.get_u32_le();
21493 __struct.ram_total = buf.get_u32_le();
21494 for v in &mut __struct.storage_type {
21495 let val = buf.get_u32_le();
21496 *v = val;
21497 }
21498 for v in &mut __struct.storage_usage {
21499 let val = buf.get_u32_le();
21500 *v = val;
21501 }
21502 for v in &mut __struct.storage_total {
21503 let val = buf.get_u32_le();
21504 *v = val;
21505 }
21506 for v in &mut __struct.link_type {
21507 let val = buf.get_u32_le();
21508 *v = val;
21509 }
21510 for v in &mut __struct.link_tx_rate {
21511 let val = buf.get_u32_le();
21512 *v = val;
21513 }
21514 for v in &mut __struct.link_rx_rate {
21515 let val = buf.get_u32_le();
21516 *v = val;
21517 }
21518 for v in &mut __struct.link_tx_max {
21519 let val = buf.get_u32_le();
21520 *v = val;
21521 }
21522 for v in &mut __struct.link_rx_max {
21523 let val = buf.get_u32_le();
21524 *v = val;
21525 }
21526 for v in &mut __struct.fan_speed {
21527 let val = buf.get_i16_le();
21528 *v = val;
21529 }
21530 __struct.mavtype = buf.get_u8();
21531 for v in &mut __struct.cpu_cores {
21532 let val = buf.get_u8();
21533 *v = val;
21534 }
21535 for v in &mut __struct.cpu_combined {
21536 let val = buf.get_u8();
21537 *v = val;
21538 }
21539 for v in &mut __struct.gpu_cores {
21540 let val = buf.get_u8();
21541 *v = val;
21542 }
21543 for v in &mut __struct.gpu_combined {
21544 let val = buf.get_u8();
21545 *v = val;
21546 }
21547 __struct.temperature_board = buf.get_i8();
21548 for v in &mut __struct.temperature_core {
21549 let val = buf.get_i8();
21550 *v = val;
21551 }
21552 Ok(__struct)
21553 }
21554 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21555 let mut __tmp = BytesMut::new(bytes);
21556 #[allow(clippy::absurd_extreme_comparisons)]
21557 #[allow(unused_comparisons)]
21558 if __tmp.remaining() < Self::ENCODED_LEN {
21559 panic!(
21560 "buffer is too small (need {} bytes, but got {})",
21561 Self::ENCODED_LEN,
21562 __tmp.remaining(),
21563 )
21564 }
21565 __tmp.put_u64_le(self.time_usec);
21566 __tmp.put_u32_le(self.uptime);
21567 __tmp.put_u32_le(self.ram_usage);
21568 __tmp.put_u32_le(self.ram_total);
21569 for val in &self.storage_type {
21570 __tmp.put_u32_le(*val);
21571 }
21572 for val in &self.storage_usage {
21573 __tmp.put_u32_le(*val);
21574 }
21575 for val in &self.storage_total {
21576 __tmp.put_u32_le(*val);
21577 }
21578 for val in &self.link_type {
21579 __tmp.put_u32_le(*val);
21580 }
21581 for val in &self.link_tx_rate {
21582 __tmp.put_u32_le(*val);
21583 }
21584 for val in &self.link_rx_rate {
21585 __tmp.put_u32_le(*val);
21586 }
21587 for val in &self.link_tx_max {
21588 __tmp.put_u32_le(*val);
21589 }
21590 for val in &self.link_rx_max {
21591 __tmp.put_u32_le(*val);
21592 }
21593 for val in &self.fan_speed {
21594 __tmp.put_i16_le(*val);
21595 }
21596 __tmp.put_u8(self.mavtype);
21597 for val in &self.cpu_cores {
21598 __tmp.put_u8(*val);
21599 }
21600 for val in &self.cpu_combined {
21601 __tmp.put_u8(*val);
21602 }
21603 for val in &self.gpu_cores {
21604 __tmp.put_u8(*val);
21605 }
21606 for val in &self.gpu_combined {
21607 __tmp.put_u8(*val);
21608 }
21609 __tmp.put_i8(self.temperature_board);
21610 for val in &self.temperature_core {
21611 __tmp.put_i8(*val);
21612 }
21613 if matches!(version, MavlinkVersion::V2) {
21614 let len = __tmp.len();
21615 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21616 } else {
21617 __tmp.len()
21618 }
21619 }
21620}
21621#[doc = "Transmitter (remote ID system) is enabled and ready to start sending location and other required information. This is streamed by transmitter. A flight controller uses it as a condition to arm."]
21622#[doc = ""]
21623#[doc = "ID: 12918"]
21624#[derive(Debug, Clone, PartialEq)]
21625#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21626#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21627#[cfg_attr(feature = "ts", derive(TS))]
21628#[cfg_attr(feature = "ts", ts(export))]
21629pub struct OPEN_DRONE_ID_ARM_STATUS_DATA {
21630 #[doc = "Status level indicating if arming is allowed."]
21631 pub status: MavOdidArmStatus,
21632 #[doc = "Text error message, should be empty if status is good to arm. Fill with nulls in unused portion."]
21633 #[cfg_attr(feature = "ts", ts(type = "string"))]
21634 pub error: CharArray<50>,
21635}
21636impl OPEN_DRONE_ID_ARM_STATUS_DATA {
21637 pub const ENCODED_LEN: usize = 51usize;
21638 pub const DEFAULT: Self = Self {
21639 status: MavOdidArmStatus::DEFAULT,
21640 error: CharArray::new([0_u8; 50usize]),
21641 };
21642 #[cfg(feature = "arbitrary")]
21643 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21644 use arbitrary::{Arbitrary, Unstructured};
21645 let mut buf = [0u8; 1024];
21646 rng.fill_bytes(&mut buf);
21647 let mut unstructured = Unstructured::new(&buf);
21648 Self::arbitrary(&mut unstructured).unwrap_or_default()
21649 }
21650}
21651impl Default for OPEN_DRONE_ID_ARM_STATUS_DATA {
21652 fn default() -> Self {
21653 Self::DEFAULT.clone()
21654 }
21655}
21656impl MessageData for OPEN_DRONE_ID_ARM_STATUS_DATA {
21657 type Message = MavMessage;
21658 const ID: u32 = 12918u32;
21659 const NAME: &'static str = "OPEN_DRONE_ID_ARM_STATUS";
21660 const EXTRA_CRC: u8 = 139u8;
21661 const ENCODED_LEN: usize = 51usize;
21662 fn deser(
21663 _version: MavlinkVersion,
21664 __input: &[u8],
21665 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21666 let avail_len = __input.len();
21667 let mut payload_buf = [0; Self::ENCODED_LEN];
21668 let mut buf = if avail_len < Self::ENCODED_LEN {
21669 payload_buf[0..avail_len].copy_from_slice(__input);
21670 Bytes::new(&payload_buf)
21671 } else {
21672 Bytes::new(__input)
21673 };
21674 let mut __struct = Self::default();
21675 let tmp = buf.get_u8();
21676 __struct.status =
21677 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21678 enum_type: "MavOdidArmStatus",
21679 value: tmp as u64,
21680 })?;
21681 let mut tmp = [0_u8; 50usize];
21682 for v in &mut tmp {
21683 *v = buf.get_u8();
21684 }
21685 __struct.error = CharArray::new(tmp);
21686 Ok(__struct)
21687 }
21688 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21689 let mut __tmp = BytesMut::new(bytes);
21690 #[allow(clippy::absurd_extreme_comparisons)]
21691 #[allow(unused_comparisons)]
21692 if __tmp.remaining() < Self::ENCODED_LEN {
21693 panic!(
21694 "buffer is too small (need {} bytes, but got {})",
21695 Self::ENCODED_LEN,
21696 __tmp.remaining(),
21697 )
21698 }
21699 __tmp.put_u8(self.status as u8);
21700 for val in &self.error {
21701 __tmp.put_u8(*val);
21702 }
21703 if matches!(version, MavlinkVersion::V2) {
21704 let len = __tmp.len();
21705 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21706 } else {
21707 __tmp.len()
21708 }
21709 }
21710}
21711#[doc = "Data for filling the OpenDroneID Authentication message. The Authentication Message defines a field that can provide a means of authenticity for the identity of the UAS (Unmanned Aircraft System). The Authentication message can have two different formats. For data page 0, the fields PageCount, Length and TimeStamp are present and AuthData is only 17 bytes. For data page 1 through 15, PageCount, Length and TimeStamp are not present and the size of AuthData is 23 bytes."]
21712#[doc = ""]
21713#[doc = "ID: 12902"]
21714#[derive(Debug, Clone, PartialEq)]
21715#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21716#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21717#[cfg_attr(feature = "ts", derive(TS))]
21718#[cfg_attr(feature = "ts", ts(export))]
21719pub struct OPEN_DRONE_ID_AUTHENTICATION_DATA {
21720 #[doc = "This field is only present for page 0. 32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
21721 pub timestamp: u32,
21722 #[doc = "System ID (0 for broadcast)."]
21723 pub target_system: u8,
21724 #[doc = "Component ID (0 for broadcast)."]
21725 pub target_component: u8,
21726 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
21727 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21728 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21729 pub id_or_mac: [u8; 20],
21730 #[doc = "Indicates the type of authentication."]
21731 pub authentication_type: MavOdidAuthType,
21732 #[doc = "Allowed range is 0 - 15."]
21733 pub data_page: u8,
21734 #[doc = "This field is only present for page 0. Allowed range is 0 - 15. See the description of struct ODID_Auth_data at <https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h>."]
21735 pub last_page_index: u8,
21736 #[doc = "This field is only present for page 0. Total bytes of authentication_data from all data pages. See the description of struct ODID_Auth_data at <https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h>."]
21737 pub length: u8,
21738 #[doc = "Opaque authentication data. For page 0, the size is only 17 bytes. For other pages, the size is 23 bytes. Shall be filled with nulls in the unused portion of the field."]
21739 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21740 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21741 pub authentication_data: [u8; 23],
21742}
21743impl OPEN_DRONE_ID_AUTHENTICATION_DATA {
21744 pub const ENCODED_LEN: usize = 53usize;
21745 pub const DEFAULT: Self = Self {
21746 timestamp: 0_u32,
21747 target_system: 0_u8,
21748 target_component: 0_u8,
21749 id_or_mac: [0_u8; 20usize],
21750 authentication_type: MavOdidAuthType::DEFAULT,
21751 data_page: 0_u8,
21752 last_page_index: 0_u8,
21753 length: 0_u8,
21754 authentication_data: [0_u8; 23usize],
21755 };
21756 #[cfg(feature = "arbitrary")]
21757 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21758 use arbitrary::{Arbitrary, Unstructured};
21759 let mut buf = [0u8; 1024];
21760 rng.fill_bytes(&mut buf);
21761 let mut unstructured = Unstructured::new(&buf);
21762 Self::arbitrary(&mut unstructured).unwrap_or_default()
21763 }
21764}
21765impl Default for OPEN_DRONE_ID_AUTHENTICATION_DATA {
21766 fn default() -> Self {
21767 Self::DEFAULT.clone()
21768 }
21769}
21770impl MessageData for OPEN_DRONE_ID_AUTHENTICATION_DATA {
21771 type Message = MavMessage;
21772 const ID: u32 = 12902u32;
21773 const NAME: &'static str = "OPEN_DRONE_ID_AUTHENTICATION";
21774 const EXTRA_CRC: u8 = 140u8;
21775 const ENCODED_LEN: usize = 53usize;
21776 fn deser(
21777 _version: MavlinkVersion,
21778 __input: &[u8],
21779 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21780 let avail_len = __input.len();
21781 let mut payload_buf = [0; Self::ENCODED_LEN];
21782 let mut buf = if avail_len < Self::ENCODED_LEN {
21783 payload_buf[0..avail_len].copy_from_slice(__input);
21784 Bytes::new(&payload_buf)
21785 } else {
21786 Bytes::new(__input)
21787 };
21788 let mut __struct = Self::default();
21789 __struct.timestamp = buf.get_u32_le();
21790 __struct.target_system = buf.get_u8();
21791 __struct.target_component = buf.get_u8();
21792 for v in &mut __struct.id_or_mac {
21793 let val = buf.get_u8();
21794 *v = val;
21795 }
21796 let tmp = buf.get_u8();
21797 __struct.authentication_type =
21798 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21799 enum_type: "MavOdidAuthType",
21800 value: tmp as u64,
21801 })?;
21802 __struct.data_page = buf.get_u8();
21803 __struct.last_page_index = buf.get_u8();
21804 __struct.length = buf.get_u8();
21805 for v in &mut __struct.authentication_data {
21806 let val = buf.get_u8();
21807 *v = val;
21808 }
21809 Ok(__struct)
21810 }
21811 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21812 let mut __tmp = BytesMut::new(bytes);
21813 #[allow(clippy::absurd_extreme_comparisons)]
21814 #[allow(unused_comparisons)]
21815 if __tmp.remaining() < Self::ENCODED_LEN {
21816 panic!(
21817 "buffer is too small (need {} bytes, but got {})",
21818 Self::ENCODED_LEN,
21819 __tmp.remaining(),
21820 )
21821 }
21822 __tmp.put_u32_le(self.timestamp);
21823 __tmp.put_u8(self.target_system);
21824 __tmp.put_u8(self.target_component);
21825 for val in &self.id_or_mac {
21826 __tmp.put_u8(*val);
21827 }
21828 __tmp.put_u8(self.authentication_type as u8);
21829 __tmp.put_u8(self.data_page);
21830 __tmp.put_u8(self.last_page_index);
21831 __tmp.put_u8(self.length);
21832 for val in &self.authentication_data {
21833 __tmp.put_u8(*val);
21834 }
21835 if matches!(version, MavlinkVersion::V2) {
21836 let len = __tmp.len();
21837 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21838 } else {
21839 __tmp.len()
21840 }
21841 }
21842}
21843#[doc = "Data for filling the OpenDroneID Basic ID message. This and the below messages are primarily meant for feeding data to/from an OpenDroneID implementation. E.g. <https://github.com/opendroneid/opendroneid-core-c>. These messages are compatible with the ASTM F3411 Remote ID standard and the ASD-STAN prEN 4709-002 Direct Remote ID standard. Additional information and usage of these messages is documented at <https://mavlink.io/en/services/opendroneid.html>."]
21844#[doc = ""]
21845#[doc = "ID: 12900"]
21846#[derive(Debug, Clone, PartialEq)]
21847#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21848#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21849#[cfg_attr(feature = "ts", derive(TS))]
21850#[cfg_attr(feature = "ts", ts(export))]
21851pub struct OPEN_DRONE_ID_BASIC_ID_DATA {
21852 #[doc = "System ID (0 for broadcast)."]
21853 pub target_system: u8,
21854 #[doc = "Component ID (0 for broadcast)."]
21855 pub target_component: u8,
21856 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
21857 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21858 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21859 pub id_or_mac: [u8; 20],
21860 #[doc = "Indicates the format for the uas_id field of this message."]
21861 pub id_type: MavOdidIdType,
21862 #[doc = "Indicates the type of UA (Unmanned Aircraft)."]
21863 pub ua_type: MavOdidUaType,
21864 #[doc = "UAS (Unmanned Aircraft System) ID following the format specified by id_type. Shall be filled with nulls in the unused portion of the field."]
21865 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21866 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21867 pub uas_id: [u8; 20],
21868}
21869impl OPEN_DRONE_ID_BASIC_ID_DATA {
21870 pub const ENCODED_LEN: usize = 44usize;
21871 pub const DEFAULT: Self = Self {
21872 target_system: 0_u8,
21873 target_component: 0_u8,
21874 id_or_mac: [0_u8; 20usize],
21875 id_type: MavOdidIdType::DEFAULT,
21876 ua_type: MavOdidUaType::DEFAULT,
21877 uas_id: [0_u8; 20usize],
21878 };
21879 #[cfg(feature = "arbitrary")]
21880 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21881 use arbitrary::{Arbitrary, Unstructured};
21882 let mut buf = [0u8; 1024];
21883 rng.fill_bytes(&mut buf);
21884 let mut unstructured = Unstructured::new(&buf);
21885 Self::arbitrary(&mut unstructured).unwrap_or_default()
21886 }
21887}
21888impl Default for OPEN_DRONE_ID_BASIC_ID_DATA {
21889 fn default() -> Self {
21890 Self::DEFAULT.clone()
21891 }
21892}
21893impl MessageData for OPEN_DRONE_ID_BASIC_ID_DATA {
21894 type Message = MavMessage;
21895 const ID: u32 = 12900u32;
21896 const NAME: &'static str = "OPEN_DRONE_ID_BASIC_ID";
21897 const EXTRA_CRC: u8 = 114u8;
21898 const ENCODED_LEN: usize = 44usize;
21899 fn deser(
21900 _version: MavlinkVersion,
21901 __input: &[u8],
21902 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21903 let avail_len = __input.len();
21904 let mut payload_buf = [0; Self::ENCODED_LEN];
21905 let mut buf = if avail_len < Self::ENCODED_LEN {
21906 payload_buf[0..avail_len].copy_from_slice(__input);
21907 Bytes::new(&payload_buf)
21908 } else {
21909 Bytes::new(__input)
21910 };
21911 let mut __struct = Self::default();
21912 __struct.target_system = buf.get_u8();
21913 __struct.target_component = buf.get_u8();
21914 for v in &mut __struct.id_or_mac {
21915 let val = buf.get_u8();
21916 *v = val;
21917 }
21918 let tmp = buf.get_u8();
21919 __struct.id_type =
21920 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21921 enum_type: "MavOdidIdType",
21922 value: tmp as u64,
21923 })?;
21924 let tmp = buf.get_u8();
21925 __struct.ua_type =
21926 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21927 enum_type: "MavOdidUaType",
21928 value: tmp as u64,
21929 })?;
21930 for v in &mut __struct.uas_id {
21931 let val = buf.get_u8();
21932 *v = val;
21933 }
21934 Ok(__struct)
21935 }
21936 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21937 let mut __tmp = BytesMut::new(bytes);
21938 #[allow(clippy::absurd_extreme_comparisons)]
21939 #[allow(unused_comparisons)]
21940 if __tmp.remaining() < Self::ENCODED_LEN {
21941 panic!(
21942 "buffer is too small (need {} bytes, but got {})",
21943 Self::ENCODED_LEN,
21944 __tmp.remaining(),
21945 )
21946 }
21947 __tmp.put_u8(self.target_system);
21948 __tmp.put_u8(self.target_component);
21949 for val in &self.id_or_mac {
21950 __tmp.put_u8(*val);
21951 }
21952 __tmp.put_u8(self.id_type as u8);
21953 __tmp.put_u8(self.ua_type as u8);
21954 for val in &self.uas_id {
21955 __tmp.put_u8(*val);
21956 }
21957 if matches!(version, MavlinkVersion::V2) {
21958 let len = __tmp.len();
21959 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21960 } else {
21961 __tmp.len()
21962 }
21963 }
21964}
21965#[doc = "Data for filling the OpenDroneID Location message. The float data types are 32-bit IEEE 754. The Location message provides the location, altitude, direction and speed of the aircraft."]
21966#[doc = ""]
21967#[doc = "ID: 12901"]
21968#[derive(Debug, Clone, PartialEq)]
21969#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21970#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21971#[cfg_attr(feature = "ts", derive(TS))]
21972#[cfg_attr(feature = "ts", ts(export))]
21973pub struct OPEN_DRONE_ID_LOCATION_DATA {
21974 #[doc = "Current latitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon)."]
21975 pub latitude: i32,
21976 #[doc = "Current longitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon)."]
21977 pub longitude: i32,
21978 #[doc = "The altitude calculated from the barometric pressue. Reference is against 29.92inHg or 1013.2mb. If unknown: -1000 m."]
21979 pub altitude_barometric: f32,
21980 #[doc = "The geodetic altitude as defined by WGS84. If unknown: -1000 m."]
21981 pub altitude_geodetic: f32,
21982 #[doc = "The current height of the unmanned aircraft above the take-off location or the ground as indicated by height_reference. If unknown: -1000 m."]
21983 pub height: f32,
21984 #[doc = "Seconds after the full hour with reference to UTC time. Typically the GPS outputs a time-of-week value in milliseconds. First convert that to UTC and then convert for this field using ((float) (time_week_ms % (60*60*1000))) / 1000. If unknown: 0xFFFF."]
21985 pub timestamp: f32,
21986 #[doc = "Direction over ground (not heading, but direction of movement) measured clockwise from true North: 0 - 35999 centi-degrees. If unknown: 36100 centi-degrees."]
21987 pub direction: u16,
21988 #[doc = "Ground speed. Positive only. If unknown: 25500 cm/s. If speed is larger than 25425 cm/s, use 25425 cm/s."]
21989 pub speed_horizontal: u16,
21990 #[doc = "The vertical speed. Up is positive. If unknown: 6300 cm/s. If speed is larger than 6200 cm/s, use 6200 cm/s. If lower than -6200 cm/s, use -6200 cm/s."]
21991 pub speed_vertical: i16,
21992 #[doc = "System ID (0 for broadcast)."]
21993 pub target_system: u8,
21994 #[doc = "Component ID (0 for broadcast)."]
21995 pub target_component: u8,
21996 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
21997 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21998 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21999 pub id_or_mac: [u8; 20],
22000 #[doc = "Indicates whether the unmanned aircraft is on the ground or in the air."]
22001 pub status: MavOdidStatus,
22002 #[doc = "Indicates the reference point for the height field."]
22003 pub height_reference: MavOdidHeightRef,
22004 #[doc = "The accuracy of the horizontal position."]
22005 pub horizontal_accuracy: MavOdidHorAcc,
22006 #[doc = "The accuracy of the vertical position."]
22007 pub vertical_accuracy: MavOdidVerAcc,
22008 #[doc = "The accuracy of the barometric altitude."]
22009 pub barometer_accuracy: MavOdidVerAcc,
22010 #[doc = "The accuracy of the horizontal and vertical speed."]
22011 pub speed_accuracy: MavOdidSpeedAcc,
22012 #[doc = "The accuracy of the timestamps."]
22013 pub timestamp_accuracy: MavOdidTimeAcc,
22014}
22015impl OPEN_DRONE_ID_LOCATION_DATA {
22016 pub const ENCODED_LEN: usize = 59usize;
22017 pub const DEFAULT: Self = Self {
22018 latitude: 0_i32,
22019 longitude: 0_i32,
22020 altitude_barometric: 0.0_f32,
22021 altitude_geodetic: 0.0_f32,
22022 height: 0.0_f32,
22023 timestamp: 0.0_f32,
22024 direction: 0_u16,
22025 speed_horizontal: 0_u16,
22026 speed_vertical: 0_i16,
22027 target_system: 0_u8,
22028 target_component: 0_u8,
22029 id_or_mac: [0_u8; 20usize],
22030 status: MavOdidStatus::DEFAULT,
22031 height_reference: MavOdidHeightRef::DEFAULT,
22032 horizontal_accuracy: MavOdidHorAcc::DEFAULT,
22033 vertical_accuracy: MavOdidVerAcc::DEFAULT,
22034 barometer_accuracy: MavOdidVerAcc::DEFAULT,
22035 speed_accuracy: MavOdidSpeedAcc::DEFAULT,
22036 timestamp_accuracy: MavOdidTimeAcc::DEFAULT,
22037 };
22038 #[cfg(feature = "arbitrary")]
22039 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22040 use arbitrary::{Arbitrary, Unstructured};
22041 let mut buf = [0u8; 1024];
22042 rng.fill_bytes(&mut buf);
22043 let mut unstructured = Unstructured::new(&buf);
22044 Self::arbitrary(&mut unstructured).unwrap_or_default()
22045 }
22046}
22047impl Default for OPEN_DRONE_ID_LOCATION_DATA {
22048 fn default() -> Self {
22049 Self::DEFAULT.clone()
22050 }
22051}
22052impl MessageData for OPEN_DRONE_ID_LOCATION_DATA {
22053 type Message = MavMessage;
22054 const ID: u32 = 12901u32;
22055 const NAME: &'static str = "OPEN_DRONE_ID_LOCATION";
22056 const EXTRA_CRC: u8 = 254u8;
22057 const ENCODED_LEN: usize = 59usize;
22058 fn deser(
22059 _version: MavlinkVersion,
22060 __input: &[u8],
22061 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22062 let avail_len = __input.len();
22063 let mut payload_buf = [0; Self::ENCODED_LEN];
22064 let mut buf = if avail_len < Self::ENCODED_LEN {
22065 payload_buf[0..avail_len].copy_from_slice(__input);
22066 Bytes::new(&payload_buf)
22067 } else {
22068 Bytes::new(__input)
22069 };
22070 let mut __struct = Self::default();
22071 __struct.latitude = buf.get_i32_le();
22072 __struct.longitude = buf.get_i32_le();
22073 __struct.altitude_barometric = buf.get_f32_le();
22074 __struct.altitude_geodetic = buf.get_f32_le();
22075 __struct.height = buf.get_f32_le();
22076 __struct.timestamp = buf.get_f32_le();
22077 __struct.direction = buf.get_u16_le();
22078 __struct.speed_horizontal = buf.get_u16_le();
22079 __struct.speed_vertical = buf.get_i16_le();
22080 __struct.target_system = buf.get_u8();
22081 __struct.target_component = buf.get_u8();
22082 for v in &mut __struct.id_or_mac {
22083 let val = buf.get_u8();
22084 *v = val;
22085 }
22086 let tmp = buf.get_u8();
22087 __struct.status =
22088 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22089 enum_type: "MavOdidStatus",
22090 value: tmp as u64,
22091 })?;
22092 let tmp = buf.get_u8();
22093 __struct.height_reference =
22094 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22095 enum_type: "MavOdidHeightRef",
22096 value: tmp as u64,
22097 })?;
22098 let tmp = buf.get_u8();
22099 __struct.horizontal_accuracy =
22100 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22101 enum_type: "MavOdidHorAcc",
22102 value: tmp as u64,
22103 })?;
22104 let tmp = buf.get_u8();
22105 __struct.vertical_accuracy =
22106 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22107 enum_type: "MavOdidVerAcc",
22108 value: tmp as u64,
22109 })?;
22110 let tmp = buf.get_u8();
22111 __struct.barometer_accuracy =
22112 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22113 enum_type: "MavOdidVerAcc",
22114 value: tmp as u64,
22115 })?;
22116 let tmp = buf.get_u8();
22117 __struct.speed_accuracy =
22118 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22119 enum_type: "MavOdidSpeedAcc",
22120 value: tmp as u64,
22121 })?;
22122 let tmp = buf.get_u8();
22123 __struct.timestamp_accuracy =
22124 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22125 enum_type: "MavOdidTimeAcc",
22126 value: tmp as u64,
22127 })?;
22128 Ok(__struct)
22129 }
22130 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22131 let mut __tmp = BytesMut::new(bytes);
22132 #[allow(clippy::absurd_extreme_comparisons)]
22133 #[allow(unused_comparisons)]
22134 if __tmp.remaining() < Self::ENCODED_LEN {
22135 panic!(
22136 "buffer is too small (need {} bytes, but got {})",
22137 Self::ENCODED_LEN,
22138 __tmp.remaining(),
22139 )
22140 }
22141 __tmp.put_i32_le(self.latitude);
22142 __tmp.put_i32_le(self.longitude);
22143 __tmp.put_f32_le(self.altitude_barometric);
22144 __tmp.put_f32_le(self.altitude_geodetic);
22145 __tmp.put_f32_le(self.height);
22146 __tmp.put_f32_le(self.timestamp);
22147 __tmp.put_u16_le(self.direction);
22148 __tmp.put_u16_le(self.speed_horizontal);
22149 __tmp.put_i16_le(self.speed_vertical);
22150 __tmp.put_u8(self.target_system);
22151 __tmp.put_u8(self.target_component);
22152 for val in &self.id_or_mac {
22153 __tmp.put_u8(*val);
22154 }
22155 __tmp.put_u8(self.status as u8);
22156 __tmp.put_u8(self.height_reference as u8);
22157 __tmp.put_u8(self.horizontal_accuracy as u8);
22158 __tmp.put_u8(self.vertical_accuracy as u8);
22159 __tmp.put_u8(self.barometer_accuracy as u8);
22160 __tmp.put_u8(self.speed_accuracy as u8);
22161 __tmp.put_u8(self.timestamp_accuracy as u8);
22162 if matches!(version, MavlinkVersion::V2) {
22163 let len = __tmp.len();
22164 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22165 } else {
22166 __tmp.len()
22167 }
22168 }
22169}
22170#[doc = "An OpenDroneID message pack is a container for multiple encoded OpenDroneID messages (i.e. not in the format given for the above message descriptions but after encoding into the compressed OpenDroneID byte format). Used e.g. when transmitting on Bluetooth 5.0 Long Range/Extended Advertising or on WiFi Neighbor Aware Networking or on WiFi Beacon."]
22171#[doc = ""]
22172#[doc = "ID: 12915"]
22173#[derive(Debug, Clone, PartialEq)]
22174#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22175#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22176#[cfg_attr(feature = "ts", derive(TS))]
22177#[cfg_attr(feature = "ts", ts(export))]
22178pub struct OPEN_DRONE_ID_MESSAGE_PACK_DATA {
22179 #[doc = "System ID (0 for broadcast)."]
22180 pub target_system: u8,
22181 #[doc = "Component ID (0 for broadcast)."]
22182 pub target_component: u8,
22183 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22184 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22185 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22186 pub id_or_mac: [u8; 20],
22187 #[doc = "This field must currently always be equal to 25 (bytes), since all encoded OpenDroneID messages are specified to have this length."]
22188 pub single_message_size: u8,
22189 #[doc = "Number of encoded messages in the pack (not the number of bytes). Allowed range is 1 - 9."]
22190 pub msg_pack_size: u8,
22191 #[doc = "Concatenation of encoded OpenDroneID messages. Shall be filled with nulls in the unused portion of the field."]
22192 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22193 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22194 pub messages: [u8; 225],
22195}
22196impl OPEN_DRONE_ID_MESSAGE_PACK_DATA {
22197 pub const ENCODED_LEN: usize = 249usize;
22198 pub const DEFAULT: Self = Self {
22199 target_system: 0_u8,
22200 target_component: 0_u8,
22201 id_or_mac: [0_u8; 20usize],
22202 single_message_size: 0_u8,
22203 msg_pack_size: 0_u8,
22204 messages: [0_u8; 225usize],
22205 };
22206 #[cfg(feature = "arbitrary")]
22207 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22208 use arbitrary::{Arbitrary, Unstructured};
22209 let mut buf = [0u8; 1024];
22210 rng.fill_bytes(&mut buf);
22211 let mut unstructured = Unstructured::new(&buf);
22212 Self::arbitrary(&mut unstructured).unwrap_or_default()
22213 }
22214}
22215impl Default for OPEN_DRONE_ID_MESSAGE_PACK_DATA {
22216 fn default() -> Self {
22217 Self::DEFAULT.clone()
22218 }
22219}
22220impl MessageData for OPEN_DRONE_ID_MESSAGE_PACK_DATA {
22221 type Message = MavMessage;
22222 const ID: u32 = 12915u32;
22223 const NAME: &'static str = "OPEN_DRONE_ID_MESSAGE_PACK";
22224 const EXTRA_CRC: u8 = 94u8;
22225 const ENCODED_LEN: usize = 249usize;
22226 fn deser(
22227 _version: MavlinkVersion,
22228 __input: &[u8],
22229 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22230 let avail_len = __input.len();
22231 let mut payload_buf = [0; Self::ENCODED_LEN];
22232 let mut buf = if avail_len < Self::ENCODED_LEN {
22233 payload_buf[0..avail_len].copy_from_slice(__input);
22234 Bytes::new(&payload_buf)
22235 } else {
22236 Bytes::new(__input)
22237 };
22238 let mut __struct = Self::default();
22239 __struct.target_system = buf.get_u8();
22240 __struct.target_component = buf.get_u8();
22241 for v in &mut __struct.id_or_mac {
22242 let val = buf.get_u8();
22243 *v = val;
22244 }
22245 __struct.single_message_size = buf.get_u8();
22246 __struct.msg_pack_size = buf.get_u8();
22247 for v in &mut __struct.messages {
22248 let val = buf.get_u8();
22249 *v = val;
22250 }
22251 Ok(__struct)
22252 }
22253 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22254 let mut __tmp = BytesMut::new(bytes);
22255 #[allow(clippy::absurd_extreme_comparisons)]
22256 #[allow(unused_comparisons)]
22257 if __tmp.remaining() < Self::ENCODED_LEN {
22258 panic!(
22259 "buffer is too small (need {} bytes, but got {})",
22260 Self::ENCODED_LEN,
22261 __tmp.remaining(),
22262 )
22263 }
22264 __tmp.put_u8(self.target_system);
22265 __tmp.put_u8(self.target_component);
22266 for val in &self.id_or_mac {
22267 __tmp.put_u8(*val);
22268 }
22269 __tmp.put_u8(self.single_message_size);
22270 __tmp.put_u8(self.msg_pack_size);
22271 for val in &self.messages {
22272 __tmp.put_u8(*val);
22273 }
22274 if matches!(version, MavlinkVersion::V2) {
22275 let len = __tmp.len();
22276 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22277 } else {
22278 __tmp.len()
22279 }
22280 }
22281}
22282#[doc = "Data for filling the OpenDroneID Operator ID message, which contains the CAA (Civil Aviation Authority) issued operator ID."]
22283#[doc = ""]
22284#[doc = "ID: 12905"]
22285#[derive(Debug, Clone, PartialEq)]
22286#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22287#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22288#[cfg_attr(feature = "ts", derive(TS))]
22289#[cfg_attr(feature = "ts", ts(export))]
22290pub struct OPEN_DRONE_ID_OPERATOR_ID_DATA {
22291 #[doc = "System ID (0 for broadcast)."]
22292 pub target_system: u8,
22293 #[doc = "Component ID (0 for broadcast)."]
22294 pub target_component: u8,
22295 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22296 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22297 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22298 pub id_or_mac: [u8; 20],
22299 #[doc = "Indicates the type of the operator_id field."]
22300 pub operator_id_type: MavOdidOperatorIdType,
22301 #[doc = "Text description or numeric value expressed as ASCII characters. Shall be filled with nulls in the unused portion of the field."]
22302 #[cfg_attr(feature = "ts", ts(type = "string"))]
22303 pub operator_id: CharArray<20>,
22304}
22305impl OPEN_DRONE_ID_OPERATOR_ID_DATA {
22306 pub const ENCODED_LEN: usize = 43usize;
22307 pub const DEFAULT: Self = Self {
22308 target_system: 0_u8,
22309 target_component: 0_u8,
22310 id_or_mac: [0_u8; 20usize],
22311 operator_id_type: MavOdidOperatorIdType::DEFAULT,
22312 operator_id: CharArray::new([0_u8; 20usize]),
22313 };
22314 #[cfg(feature = "arbitrary")]
22315 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22316 use arbitrary::{Arbitrary, Unstructured};
22317 let mut buf = [0u8; 1024];
22318 rng.fill_bytes(&mut buf);
22319 let mut unstructured = Unstructured::new(&buf);
22320 Self::arbitrary(&mut unstructured).unwrap_or_default()
22321 }
22322}
22323impl Default for OPEN_DRONE_ID_OPERATOR_ID_DATA {
22324 fn default() -> Self {
22325 Self::DEFAULT.clone()
22326 }
22327}
22328impl MessageData for OPEN_DRONE_ID_OPERATOR_ID_DATA {
22329 type Message = MavMessage;
22330 const ID: u32 = 12905u32;
22331 const NAME: &'static str = "OPEN_DRONE_ID_OPERATOR_ID";
22332 const EXTRA_CRC: u8 = 49u8;
22333 const ENCODED_LEN: usize = 43usize;
22334 fn deser(
22335 _version: MavlinkVersion,
22336 __input: &[u8],
22337 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22338 let avail_len = __input.len();
22339 let mut payload_buf = [0; Self::ENCODED_LEN];
22340 let mut buf = if avail_len < Self::ENCODED_LEN {
22341 payload_buf[0..avail_len].copy_from_slice(__input);
22342 Bytes::new(&payload_buf)
22343 } else {
22344 Bytes::new(__input)
22345 };
22346 let mut __struct = Self::default();
22347 __struct.target_system = buf.get_u8();
22348 __struct.target_component = buf.get_u8();
22349 for v in &mut __struct.id_or_mac {
22350 let val = buf.get_u8();
22351 *v = val;
22352 }
22353 let tmp = buf.get_u8();
22354 __struct.operator_id_type =
22355 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22356 enum_type: "MavOdidOperatorIdType",
22357 value: tmp as u64,
22358 })?;
22359 let mut tmp = [0_u8; 20usize];
22360 for v in &mut tmp {
22361 *v = buf.get_u8();
22362 }
22363 __struct.operator_id = CharArray::new(tmp);
22364 Ok(__struct)
22365 }
22366 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22367 let mut __tmp = BytesMut::new(bytes);
22368 #[allow(clippy::absurd_extreme_comparisons)]
22369 #[allow(unused_comparisons)]
22370 if __tmp.remaining() < Self::ENCODED_LEN {
22371 panic!(
22372 "buffer is too small (need {} bytes, but got {})",
22373 Self::ENCODED_LEN,
22374 __tmp.remaining(),
22375 )
22376 }
22377 __tmp.put_u8(self.target_system);
22378 __tmp.put_u8(self.target_component);
22379 for val in &self.id_or_mac {
22380 __tmp.put_u8(*val);
22381 }
22382 __tmp.put_u8(self.operator_id_type as u8);
22383 for val in &self.operator_id {
22384 __tmp.put_u8(*val);
22385 }
22386 if matches!(version, MavlinkVersion::V2) {
22387 let len = __tmp.len();
22388 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22389 } else {
22390 __tmp.len()
22391 }
22392 }
22393}
22394#[doc = "Data for filling the OpenDroneID Self ID message. The Self ID Message is an opportunity for the operator to (optionally) declare their identity and purpose of the flight. This message can provide additional information that could reduce the threat profile of a UA (Unmanned Aircraft) flying in a particular area or manner. This message can also be used to provide optional additional clarification in an emergency/remote ID system failure situation."]
22395#[doc = ""]
22396#[doc = "ID: 12903"]
22397#[derive(Debug, Clone, PartialEq)]
22398#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22399#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22400#[cfg_attr(feature = "ts", derive(TS))]
22401#[cfg_attr(feature = "ts", ts(export))]
22402pub struct OPEN_DRONE_ID_SELF_ID_DATA {
22403 #[doc = "System ID (0 for broadcast)."]
22404 pub target_system: u8,
22405 #[doc = "Component ID (0 for broadcast)."]
22406 pub target_component: u8,
22407 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22408 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22409 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22410 pub id_or_mac: [u8; 20],
22411 #[doc = "Indicates the type of the description field."]
22412 pub description_type: MavOdidDescType,
22413 #[doc = "Text description or numeric value expressed as ASCII characters. Shall be filled with nulls in the unused portion of the field."]
22414 #[cfg_attr(feature = "ts", ts(type = "string"))]
22415 pub description: CharArray<23>,
22416}
22417impl OPEN_DRONE_ID_SELF_ID_DATA {
22418 pub const ENCODED_LEN: usize = 46usize;
22419 pub const DEFAULT: Self = Self {
22420 target_system: 0_u8,
22421 target_component: 0_u8,
22422 id_or_mac: [0_u8; 20usize],
22423 description_type: MavOdidDescType::DEFAULT,
22424 description: CharArray::new([0_u8; 23usize]),
22425 };
22426 #[cfg(feature = "arbitrary")]
22427 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22428 use arbitrary::{Arbitrary, Unstructured};
22429 let mut buf = [0u8; 1024];
22430 rng.fill_bytes(&mut buf);
22431 let mut unstructured = Unstructured::new(&buf);
22432 Self::arbitrary(&mut unstructured).unwrap_or_default()
22433 }
22434}
22435impl Default for OPEN_DRONE_ID_SELF_ID_DATA {
22436 fn default() -> Self {
22437 Self::DEFAULT.clone()
22438 }
22439}
22440impl MessageData for OPEN_DRONE_ID_SELF_ID_DATA {
22441 type Message = MavMessage;
22442 const ID: u32 = 12903u32;
22443 const NAME: &'static str = "OPEN_DRONE_ID_SELF_ID";
22444 const EXTRA_CRC: u8 = 249u8;
22445 const ENCODED_LEN: usize = 46usize;
22446 fn deser(
22447 _version: MavlinkVersion,
22448 __input: &[u8],
22449 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22450 let avail_len = __input.len();
22451 let mut payload_buf = [0; Self::ENCODED_LEN];
22452 let mut buf = if avail_len < Self::ENCODED_LEN {
22453 payload_buf[0..avail_len].copy_from_slice(__input);
22454 Bytes::new(&payload_buf)
22455 } else {
22456 Bytes::new(__input)
22457 };
22458 let mut __struct = Self::default();
22459 __struct.target_system = buf.get_u8();
22460 __struct.target_component = buf.get_u8();
22461 for v in &mut __struct.id_or_mac {
22462 let val = buf.get_u8();
22463 *v = val;
22464 }
22465 let tmp = buf.get_u8();
22466 __struct.description_type =
22467 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22468 enum_type: "MavOdidDescType",
22469 value: tmp as u64,
22470 })?;
22471 let mut tmp = [0_u8; 23usize];
22472 for v in &mut tmp {
22473 *v = buf.get_u8();
22474 }
22475 __struct.description = CharArray::new(tmp);
22476 Ok(__struct)
22477 }
22478 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22479 let mut __tmp = BytesMut::new(bytes);
22480 #[allow(clippy::absurd_extreme_comparisons)]
22481 #[allow(unused_comparisons)]
22482 if __tmp.remaining() < Self::ENCODED_LEN {
22483 panic!(
22484 "buffer is too small (need {} bytes, but got {})",
22485 Self::ENCODED_LEN,
22486 __tmp.remaining(),
22487 )
22488 }
22489 __tmp.put_u8(self.target_system);
22490 __tmp.put_u8(self.target_component);
22491 for val in &self.id_or_mac {
22492 __tmp.put_u8(*val);
22493 }
22494 __tmp.put_u8(self.description_type as u8);
22495 for val in &self.description {
22496 __tmp.put_u8(*val);
22497 }
22498 if matches!(version, MavlinkVersion::V2) {
22499 let len = __tmp.len();
22500 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22501 } else {
22502 __tmp.len()
22503 }
22504 }
22505}
22506#[doc = "Data for filling the OpenDroneID System message. The System Message contains general system information including the operator location/altitude and possible aircraft group and/or category/class information."]
22507#[doc = ""]
22508#[doc = "ID: 12904"]
22509#[derive(Debug, Clone, PartialEq)]
22510#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22511#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22512#[cfg_attr(feature = "ts", derive(TS))]
22513#[cfg_attr(feature = "ts", ts(export))]
22514pub struct OPEN_DRONE_ID_SYSTEM_DATA {
22515 #[doc = "Latitude of the operator. If unknown: 0 (both Lat/Lon)."]
22516 pub operator_latitude: i32,
22517 #[doc = "Longitude of the operator. If unknown: 0 (both Lat/Lon)."]
22518 pub operator_longitude: i32,
22519 #[doc = "Area Operations Ceiling relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA."]
22520 pub area_ceiling: f32,
22521 #[doc = "Area Operations Floor relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA."]
22522 pub area_floor: f32,
22523 #[doc = "Geodetic altitude of the operator relative to WGS84. If unknown: -1000 m."]
22524 pub operator_altitude_geo: f32,
22525 #[doc = "32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
22526 pub timestamp: u32,
22527 #[doc = "Number of aircraft in the area, group or formation (default 1). Used only for swarms/multiple UA."]
22528 pub area_count: u16,
22529 #[doc = "Radius of the cylindrical area of the group or formation (default 0). Used only for swarms/multiple UA."]
22530 pub area_radius: u16,
22531 #[doc = "System ID (0 for broadcast)."]
22532 pub target_system: u8,
22533 #[doc = "Component ID (0 for broadcast)."]
22534 pub target_component: u8,
22535 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22536 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22537 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22538 pub id_or_mac: [u8; 20],
22539 #[doc = "Specifies the operator location type."]
22540 pub operator_location_type: MavOdidOperatorLocationType,
22541 #[doc = "Specifies the classification type of the UA."]
22542 pub classification_type: MavOdidClassificationType,
22543 #[doc = "When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the category of the UA."]
22544 pub category_eu: MavOdidCategoryEu,
22545 #[doc = "When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the class of the UA."]
22546 pub class_eu: MavOdidClassEu,
22547}
22548impl OPEN_DRONE_ID_SYSTEM_DATA {
22549 pub const ENCODED_LEN: usize = 54usize;
22550 pub const DEFAULT: Self = Self {
22551 operator_latitude: 0_i32,
22552 operator_longitude: 0_i32,
22553 area_ceiling: 0.0_f32,
22554 area_floor: 0.0_f32,
22555 operator_altitude_geo: 0.0_f32,
22556 timestamp: 0_u32,
22557 area_count: 0_u16,
22558 area_radius: 0_u16,
22559 target_system: 0_u8,
22560 target_component: 0_u8,
22561 id_or_mac: [0_u8; 20usize],
22562 operator_location_type: MavOdidOperatorLocationType::DEFAULT,
22563 classification_type: MavOdidClassificationType::DEFAULT,
22564 category_eu: MavOdidCategoryEu::DEFAULT,
22565 class_eu: MavOdidClassEu::DEFAULT,
22566 };
22567 #[cfg(feature = "arbitrary")]
22568 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22569 use arbitrary::{Arbitrary, Unstructured};
22570 let mut buf = [0u8; 1024];
22571 rng.fill_bytes(&mut buf);
22572 let mut unstructured = Unstructured::new(&buf);
22573 Self::arbitrary(&mut unstructured).unwrap_or_default()
22574 }
22575}
22576impl Default for OPEN_DRONE_ID_SYSTEM_DATA {
22577 fn default() -> Self {
22578 Self::DEFAULT.clone()
22579 }
22580}
22581impl MessageData for OPEN_DRONE_ID_SYSTEM_DATA {
22582 type Message = MavMessage;
22583 const ID: u32 = 12904u32;
22584 const NAME: &'static str = "OPEN_DRONE_ID_SYSTEM";
22585 const EXTRA_CRC: u8 = 77u8;
22586 const ENCODED_LEN: usize = 54usize;
22587 fn deser(
22588 _version: MavlinkVersion,
22589 __input: &[u8],
22590 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22591 let avail_len = __input.len();
22592 let mut payload_buf = [0; Self::ENCODED_LEN];
22593 let mut buf = if avail_len < Self::ENCODED_LEN {
22594 payload_buf[0..avail_len].copy_from_slice(__input);
22595 Bytes::new(&payload_buf)
22596 } else {
22597 Bytes::new(__input)
22598 };
22599 let mut __struct = Self::default();
22600 __struct.operator_latitude = buf.get_i32_le();
22601 __struct.operator_longitude = buf.get_i32_le();
22602 __struct.area_ceiling = buf.get_f32_le();
22603 __struct.area_floor = buf.get_f32_le();
22604 __struct.operator_altitude_geo = buf.get_f32_le();
22605 __struct.timestamp = buf.get_u32_le();
22606 __struct.area_count = buf.get_u16_le();
22607 __struct.area_radius = buf.get_u16_le();
22608 __struct.target_system = buf.get_u8();
22609 __struct.target_component = buf.get_u8();
22610 for v in &mut __struct.id_or_mac {
22611 let val = buf.get_u8();
22612 *v = val;
22613 }
22614 let tmp = buf.get_u8();
22615 __struct.operator_location_type =
22616 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22617 enum_type: "MavOdidOperatorLocationType",
22618 value: tmp as u64,
22619 })?;
22620 let tmp = buf.get_u8();
22621 __struct.classification_type =
22622 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22623 enum_type: "MavOdidClassificationType",
22624 value: tmp as u64,
22625 })?;
22626 let tmp = buf.get_u8();
22627 __struct.category_eu =
22628 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22629 enum_type: "MavOdidCategoryEu",
22630 value: tmp as u64,
22631 })?;
22632 let tmp = buf.get_u8();
22633 __struct.class_eu =
22634 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22635 enum_type: "MavOdidClassEu",
22636 value: tmp as u64,
22637 })?;
22638 Ok(__struct)
22639 }
22640 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22641 let mut __tmp = BytesMut::new(bytes);
22642 #[allow(clippy::absurd_extreme_comparisons)]
22643 #[allow(unused_comparisons)]
22644 if __tmp.remaining() < Self::ENCODED_LEN {
22645 panic!(
22646 "buffer is too small (need {} bytes, but got {})",
22647 Self::ENCODED_LEN,
22648 __tmp.remaining(),
22649 )
22650 }
22651 __tmp.put_i32_le(self.operator_latitude);
22652 __tmp.put_i32_le(self.operator_longitude);
22653 __tmp.put_f32_le(self.area_ceiling);
22654 __tmp.put_f32_le(self.area_floor);
22655 __tmp.put_f32_le(self.operator_altitude_geo);
22656 __tmp.put_u32_le(self.timestamp);
22657 __tmp.put_u16_le(self.area_count);
22658 __tmp.put_u16_le(self.area_radius);
22659 __tmp.put_u8(self.target_system);
22660 __tmp.put_u8(self.target_component);
22661 for val in &self.id_or_mac {
22662 __tmp.put_u8(*val);
22663 }
22664 __tmp.put_u8(self.operator_location_type as u8);
22665 __tmp.put_u8(self.classification_type as u8);
22666 __tmp.put_u8(self.category_eu as u8);
22667 __tmp.put_u8(self.class_eu as u8);
22668 if matches!(version, MavlinkVersion::V2) {
22669 let len = __tmp.len();
22670 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22671 } else {
22672 __tmp.len()
22673 }
22674 }
22675}
22676#[doc = "Update the data in the OPEN_DRONE_ID_SYSTEM message with new location information. This can be sent to update the location information for the operator when no other information in the SYSTEM message has changed. This message allows for efficient operation on radio links which have limited uplink bandwidth while meeting requirements for update frequency of the operator location."]
22677#[doc = ""]
22678#[doc = "ID: 12919"]
22679#[derive(Debug, Clone, PartialEq)]
22680#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22681#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22682#[cfg_attr(feature = "ts", derive(TS))]
22683#[cfg_attr(feature = "ts", ts(export))]
22684pub struct OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
22685 #[doc = "Latitude of the operator. If unknown: 0 (both Lat/Lon)."]
22686 pub operator_latitude: i32,
22687 #[doc = "Longitude of the operator. If unknown: 0 (both Lat/Lon)."]
22688 pub operator_longitude: i32,
22689 #[doc = "Geodetic altitude of the operator relative to WGS84. If unknown: -1000 m."]
22690 pub operator_altitude_geo: f32,
22691 #[doc = "32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
22692 pub timestamp: u32,
22693 #[doc = "System ID (0 for broadcast)."]
22694 pub target_system: u8,
22695 #[doc = "Component ID (0 for broadcast)."]
22696 pub target_component: u8,
22697}
22698impl OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
22699 pub const ENCODED_LEN: usize = 18usize;
22700 pub const DEFAULT: Self = Self {
22701 operator_latitude: 0_i32,
22702 operator_longitude: 0_i32,
22703 operator_altitude_geo: 0.0_f32,
22704 timestamp: 0_u32,
22705 target_system: 0_u8,
22706 target_component: 0_u8,
22707 };
22708 #[cfg(feature = "arbitrary")]
22709 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22710 use arbitrary::{Arbitrary, Unstructured};
22711 let mut buf = [0u8; 1024];
22712 rng.fill_bytes(&mut buf);
22713 let mut unstructured = Unstructured::new(&buf);
22714 Self::arbitrary(&mut unstructured).unwrap_or_default()
22715 }
22716}
22717impl Default for OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
22718 fn default() -> Self {
22719 Self::DEFAULT.clone()
22720 }
22721}
22722impl MessageData for OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
22723 type Message = MavMessage;
22724 const ID: u32 = 12919u32;
22725 const NAME: &'static str = "OPEN_DRONE_ID_SYSTEM_UPDATE";
22726 const EXTRA_CRC: u8 = 7u8;
22727 const ENCODED_LEN: usize = 18usize;
22728 fn deser(
22729 _version: MavlinkVersion,
22730 __input: &[u8],
22731 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22732 let avail_len = __input.len();
22733 let mut payload_buf = [0; Self::ENCODED_LEN];
22734 let mut buf = if avail_len < Self::ENCODED_LEN {
22735 payload_buf[0..avail_len].copy_from_slice(__input);
22736 Bytes::new(&payload_buf)
22737 } else {
22738 Bytes::new(__input)
22739 };
22740 let mut __struct = Self::default();
22741 __struct.operator_latitude = buf.get_i32_le();
22742 __struct.operator_longitude = buf.get_i32_le();
22743 __struct.operator_altitude_geo = buf.get_f32_le();
22744 __struct.timestamp = buf.get_u32_le();
22745 __struct.target_system = buf.get_u8();
22746 __struct.target_component = buf.get_u8();
22747 Ok(__struct)
22748 }
22749 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22750 let mut __tmp = BytesMut::new(bytes);
22751 #[allow(clippy::absurd_extreme_comparisons)]
22752 #[allow(unused_comparisons)]
22753 if __tmp.remaining() < Self::ENCODED_LEN {
22754 panic!(
22755 "buffer is too small (need {} bytes, but got {})",
22756 Self::ENCODED_LEN,
22757 __tmp.remaining(),
22758 )
22759 }
22760 __tmp.put_i32_le(self.operator_latitude);
22761 __tmp.put_i32_le(self.operator_longitude);
22762 __tmp.put_f32_le(self.operator_altitude_geo);
22763 __tmp.put_u32_le(self.timestamp);
22764 __tmp.put_u8(self.target_system);
22765 __tmp.put_u8(self.target_component);
22766 if matches!(version, MavlinkVersion::V2) {
22767 let len = __tmp.len();
22768 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22769 } else {
22770 __tmp.len()
22771 }
22772 }
22773}
22774#[doc = "Optical flow from a flow sensor (e.g. optical mouse sensor)."]
22775#[doc = ""]
22776#[doc = "ID: 100"]
22777#[derive(Debug, Clone, PartialEq)]
22778#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22779#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22780#[cfg_attr(feature = "ts", derive(TS))]
22781#[cfg_attr(feature = "ts", ts(export))]
22782pub struct OPTICAL_FLOW_DATA {
22783 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
22784 pub time_usec: u64,
22785 #[doc = "Flow in x-sensor direction, angular-speed compensated"]
22786 pub flow_comp_m_x: f32,
22787 #[doc = "Flow in y-sensor direction, angular-speed compensated"]
22788 pub flow_comp_m_y: f32,
22789 #[doc = "Ground distance. Positive value: distance known. Negative value: Unknown distance"]
22790 pub ground_distance: f32,
22791 #[doc = "Flow in x-sensor direction"]
22792 pub flow_x: i16,
22793 #[doc = "Flow in y-sensor direction"]
22794 pub flow_y: i16,
22795 #[doc = "Sensor ID"]
22796 pub sensor_id: u8,
22797 #[doc = "Optical flow quality / confidence. 0: bad, 255: maximum quality"]
22798 pub quality: u8,
22799 #[doc = "Flow rate about X axis"]
22800 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
22801 pub flow_rate_x: f32,
22802 #[doc = "Flow rate about Y axis"]
22803 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
22804 pub flow_rate_y: f32,
22805}
22806impl OPTICAL_FLOW_DATA {
22807 pub const ENCODED_LEN: usize = 34usize;
22808 pub const DEFAULT: Self = Self {
22809 time_usec: 0_u64,
22810 flow_comp_m_x: 0.0_f32,
22811 flow_comp_m_y: 0.0_f32,
22812 ground_distance: 0.0_f32,
22813 flow_x: 0_i16,
22814 flow_y: 0_i16,
22815 sensor_id: 0_u8,
22816 quality: 0_u8,
22817 flow_rate_x: 0.0_f32,
22818 flow_rate_y: 0.0_f32,
22819 };
22820 #[cfg(feature = "arbitrary")]
22821 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22822 use arbitrary::{Arbitrary, Unstructured};
22823 let mut buf = [0u8; 1024];
22824 rng.fill_bytes(&mut buf);
22825 let mut unstructured = Unstructured::new(&buf);
22826 Self::arbitrary(&mut unstructured).unwrap_or_default()
22827 }
22828}
22829impl Default for OPTICAL_FLOW_DATA {
22830 fn default() -> Self {
22831 Self::DEFAULT.clone()
22832 }
22833}
22834impl MessageData for OPTICAL_FLOW_DATA {
22835 type Message = MavMessage;
22836 const ID: u32 = 100u32;
22837 const NAME: &'static str = "OPTICAL_FLOW";
22838 const EXTRA_CRC: u8 = 175u8;
22839 const ENCODED_LEN: usize = 34usize;
22840 fn deser(
22841 _version: MavlinkVersion,
22842 __input: &[u8],
22843 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22844 let avail_len = __input.len();
22845 let mut payload_buf = [0; Self::ENCODED_LEN];
22846 let mut buf = if avail_len < Self::ENCODED_LEN {
22847 payload_buf[0..avail_len].copy_from_slice(__input);
22848 Bytes::new(&payload_buf)
22849 } else {
22850 Bytes::new(__input)
22851 };
22852 let mut __struct = Self::default();
22853 __struct.time_usec = buf.get_u64_le();
22854 __struct.flow_comp_m_x = buf.get_f32_le();
22855 __struct.flow_comp_m_y = buf.get_f32_le();
22856 __struct.ground_distance = buf.get_f32_le();
22857 __struct.flow_x = buf.get_i16_le();
22858 __struct.flow_y = buf.get_i16_le();
22859 __struct.sensor_id = buf.get_u8();
22860 __struct.quality = buf.get_u8();
22861 __struct.flow_rate_x = buf.get_f32_le();
22862 __struct.flow_rate_y = buf.get_f32_le();
22863 Ok(__struct)
22864 }
22865 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22866 let mut __tmp = BytesMut::new(bytes);
22867 #[allow(clippy::absurd_extreme_comparisons)]
22868 #[allow(unused_comparisons)]
22869 if __tmp.remaining() < Self::ENCODED_LEN {
22870 panic!(
22871 "buffer is too small (need {} bytes, but got {})",
22872 Self::ENCODED_LEN,
22873 __tmp.remaining(),
22874 )
22875 }
22876 __tmp.put_u64_le(self.time_usec);
22877 __tmp.put_f32_le(self.flow_comp_m_x);
22878 __tmp.put_f32_le(self.flow_comp_m_y);
22879 __tmp.put_f32_le(self.ground_distance);
22880 __tmp.put_i16_le(self.flow_x);
22881 __tmp.put_i16_le(self.flow_y);
22882 __tmp.put_u8(self.sensor_id);
22883 __tmp.put_u8(self.quality);
22884 if matches!(version, MavlinkVersion::V2) {
22885 __tmp.put_f32_le(self.flow_rate_x);
22886 __tmp.put_f32_le(self.flow_rate_y);
22887 let len = __tmp.len();
22888 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22889 } else {
22890 __tmp.len()
22891 }
22892 }
22893}
22894#[doc = "Optical flow from an angular rate flow sensor (e.g. PX4FLOW or mouse sensor)."]
22895#[doc = ""]
22896#[doc = "ID: 106"]
22897#[derive(Debug, Clone, PartialEq)]
22898#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22899#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22900#[cfg_attr(feature = "ts", derive(TS))]
22901#[cfg_attr(feature = "ts", ts(export))]
22902pub struct OPTICAL_FLOW_RAD_DATA {
22903 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
22904 pub time_usec: u64,
22905 #[doc = "Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the."]
22906 pub integration_time_us: u32,
22907 #[doc = "Flow around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)"]
22908 pub integrated_x: f32,
22909 #[doc = "Flow around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)"]
22910 pub integrated_y: f32,
22911 #[doc = "RH rotation around X axis"]
22912 pub integrated_xgyro: f32,
22913 #[doc = "RH rotation around Y axis"]
22914 pub integrated_ygyro: f32,
22915 #[doc = "RH rotation around Z axis"]
22916 pub integrated_zgyro: f32,
22917 #[doc = "Time since the distance was sampled."]
22918 pub time_delta_distance_us: u32,
22919 #[doc = "Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance."]
22920 pub distance: f32,
22921 #[doc = "Temperature"]
22922 pub temperature: i16,
22923 #[doc = "Sensor ID"]
22924 pub sensor_id: u8,
22925 #[doc = "Optical flow quality / confidence. 0: no valid flow, 255: maximum quality"]
22926 pub quality: u8,
22927}
22928impl OPTICAL_FLOW_RAD_DATA {
22929 pub const ENCODED_LEN: usize = 44usize;
22930 pub const DEFAULT: Self = Self {
22931 time_usec: 0_u64,
22932 integration_time_us: 0_u32,
22933 integrated_x: 0.0_f32,
22934 integrated_y: 0.0_f32,
22935 integrated_xgyro: 0.0_f32,
22936 integrated_ygyro: 0.0_f32,
22937 integrated_zgyro: 0.0_f32,
22938 time_delta_distance_us: 0_u32,
22939 distance: 0.0_f32,
22940 temperature: 0_i16,
22941 sensor_id: 0_u8,
22942 quality: 0_u8,
22943 };
22944 #[cfg(feature = "arbitrary")]
22945 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22946 use arbitrary::{Arbitrary, Unstructured};
22947 let mut buf = [0u8; 1024];
22948 rng.fill_bytes(&mut buf);
22949 let mut unstructured = Unstructured::new(&buf);
22950 Self::arbitrary(&mut unstructured).unwrap_or_default()
22951 }
22952}
22953impl Default for OPTICAL_FLOW_RAD_DATA {
22954 fn default() -> Self {
22955 Self::DEFAULT.clone()
22956 }
22957}
22958impl MessageData for OPTICAL_FLOW_RAD_DATA {
22959 type Message = MavMessage;
22960 const ID: u32 = 106u32;
22961 const NAME: &'static str = "OPTICAL_FLOW_RAD";
22962 const EXTRA_CRC: u8 = 138u8;
22963 const ENCODED_LEN: usize = 44usize;
22964 fn deser(
22965 _version: MavlinkVersion,
22966 __input: &[u8],
22967 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22968 let avail_len = __input.len();
22969 let mut payload_buf = [0; Self::ENCODED_LEN];
22970 let mut buf = if avail_len < Self::ENCODED_LEN {
22971 payload_buf[0..avail_len].copy_from_slice(__input);
22972 Bytes::new(&payload_buf)
22973 } else {
22974 Bytes::new(__input)
22975 };
22976 let mut __struct = Self::default();
22977 __struct.time_usec = buf.get_u64_le();
22978 __struct.integration_time_us = buf.get_u32_le();
22979 __struct.integrated_x = buf.get_f32_le();
22980 __struct.integrated_y = buf.get_f32_le();
22981 __struct.integrated_xgyro = buf.get_f32_le();
22982 __struct.integrated_ygyro = buf.get_f32_le();
22983 __struct.integrated_zgyro = buf.get_f32_le();
22984 __struct.time_delta_distance_us = buf.get_u32_le();
22985 __struct.distance = buf.get_f32_le();
22986 __struct.temperature = buf.get_i16_le();
22987 __struct.sensor_id = buf.get_u8();
22988 __struct.quality = buf.get_u8();
22989 Ok(__struct)
22990 }
22991 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22992 let mut __tmp = BytesMut::new(bytes);
22993 #[allow(clippy::absurd_extreme_comparisons)]
22994 #[allow(unused_comparisons)]
22995 if __tmp.remaining() < Self::ENCODED_LEN {
22996 panic!(
22997 "buffer is too small (need {} bytes, but got {})",
22998 Self::ENCODED_LEN,
22999 __tmp.remaining(),
23000 )
23001 }
23002 __tmp.put_u64_le(self.time_usec);
23003 __tmp.put_u32_le(self.integration_time_us);
23004 __tmp.put_f32_le(self.integrated_x);
23005 __tmp.put_f32_le(self.integrated_y);
23006 __tmp.put_f32_le(self.integrated_xgyro);
23007 __tmp.put_f32_le(self.integrated_ygyro);
23008 __tmp.put_f32_le(self.integrated_zgyro);
23009 __tmp.put_u32_le(self.time_delta_distance_us);
23010 __tmp.put_f32_le(self.distance);
23011 __tmp.put_i16_le(self.temperature);
23012 __tmp.put_u8(self.sensor_id);
23013 __tmp.put_u8(self.quality);
23014 if matches!(version, MavlinkVersion::V2) {
23015 let len = __tmp.len();
23016 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23017 } else {
23018 __tmp.len()
23019 }
23020 }
23021}
23022#[doc = "Vehicle status report that is sent out while orbit execution is in progress (see MAV_CMD_DO_ORBIT)."]
23023#[doc = ""]
23024#[doc = "ID: 360"]
23025#[derive(Debug, Clone, PartialEq)]
23026#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23027#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23028#[cfg_attr(feature = "ts", derive(TS))]
23029#[cfg_attr(feature = "ts", ts(export))]
23030pub struct ORBIT_EXECUTION_STATUS_DATA {
23031 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
23032 pub time_usec: u64,
23033 #[doc = "Radius of the orbit circle. Positive values orbit clockwise, negative values orbit counter-clockwise."]
23034 pub radius: f32,
23035 #[doc = "X coordinate of center point. Coordinate system depends on frame field: local = x position in meters * 1e4, global = latitude in degrees * 1e7."]
23036 pub x: i32,
23037 #[doc = "Y coordinate of center point. Coordinate system depends on frame field: local = x position in meters * 1e4, global = latitude in degrees * 1e7."]
23038 pub y: i32,
23039 #[doc = "Altitude of center point. Coordinate system depends on frame field."]
23040 pub z: f32,
23041 #[doc = "The coordinate system of the fields: x, y, z."]
23042 pub frame: MavFrame,
23043}
23044impl ORBIT_EXECUTION_STATUS_DATA {
23045 pub const ENCODED_LEN: usize = 25usize;
23046 pub const DEFAULT: Self = Self {
23047 time_usec: 0_u64,
23048 radius: 0.0_f32,
23049 x: 0_i32,
23050 y: 0_i32,
23051 z: 0.0_f32,
23052 frame: MavFrame::DEFAULT,
23053 };
23054 #[cfg(feature = "arbitrary")]
23055 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23056 use arbitrary::{Arbitrary, Unstructured};
23057 let mut buf = [0u8; 1024];
23058 rng.fill_bytes(&mut buf);
23059 let mut unstructured = Unstructured::new(&buf);
23060 Self::arbitrary(&mut unstructured).unwrap_or_default()
23061 }
23062}
23063impl Default for ORBIT_EXECUTION_STATUS_DATA {
23064 fn default() -> Self {
23065 Self::DEFAULT.clone()
23066 }
23067}
23068impl MessageData for ORBIT_EXECUTION_STATUS_DATA {
23069 type Message = MavMessage;
23070 const ID: u32 = 360u32;
23071 const NAME: &'static str = "ORBIT_EXECUTION_STATUS";
23072 const EXTRA_CRC: u8 = 11u8;
23073 const ENCODED_LEN: usize = 25usize;
23074 fn deser(
23075 _version: MavlinkVersion,
23076 __input: &[u8],
23077 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23078 let avail_len = __input.len();
23079 let mut payload_buf = [0; Self::ENCODED_LEN];
23080 let mut buf = if avail_len < Self::ENCODED_LEN {
23081 payload_buf[0..avail_len].copy_from_slice(__input);
23082 Bytes::new(&payload_buf)
23083 } else {
23084 Bytes::new(__input)
23085 };
23086 let mut __struct = Self::default();
23087 __struct.time_usec = buf.get_u64_le();
23088 __struct.radius = buf.get_f32_le();
23089 __struct.x = buf.get_i32_le();
23090 __struct.y = buf.get_i32_le();
23091 __struct.z = buf.get_f32_le();
23092 let tmp = buf.get_u8();
23093 __struct.frame =
23094 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23095 enum_type: "MavFrame",
23096 value: tmp as u64,
23097 })?;
23098 Ok(__struct)
23099 }
23100 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23101 let mut __tmp = BytesMut::new(bytes);
23102 #[allow(clippy::absurd_extreme_comparisons)]
23103 #[allow(unused_comparisons)]
23104 if __tmp.remaining() < Self::ENCODED_LEN {
23105 panic!(
23106 "buffer is too small (need {} bytes, but got {})",
23107 Self::ENCODED_LEN,
23108 __tmp.remaining(),
23109 )
23110 }
23111 __tmp.put_u64_le(self.time_usec);
23112 __tmp.put_f32_le(self.radius);
23113 __tmp.put_i32_le(self.x);
23114 __tmp.put_i32_le(self.y);
23115 __tmp.put_f32_le(self.z);
23116 __tmp.put_u8(self.frame as u8);
23117 if matches!(version, MavlinkVersion::V2) {
23118 let len = __tmp.len();
23119 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23120 } else {
23121 __tmp.len()
23122 }
23123 }
23124}
23125#[doc = "Response from a PARAM_EXT_SET message."]
23126#[doc = ""]
23127#[doc = "ID: 324"]
23128#[derive(Debug, Clone, PartialEq)]
23129#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23130#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23131#[cfg_attr(feature = "ts", derive(TS))]
23132#[cfg_attr(feature = "ts", ts(export))]
23133pub struct PARAM_EXT_ACK_DATA {
23134 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23135 #[cfg_attr(feature = "ts", ts(type = "string"))]
23136 pub param_id: CharArray<16>,
23137 #[doc = "Parameter value (new value if PARAM_ACK_ACCEPTED, current value otherwise)"]
23138 #[cfg_attr(feature = "ts", ts(type = "string"))]
23139 pub param_value: CharArray<128>,
23140 #[doc = "Parameter type."]
23141 pub param_type: MavParamExtType,
23142 #[doc = "Result code."]
23143 pub param_result: ParamAck,
23144}
23145impl PARAM_EXT_ACK_DATA {
23146 pub const ENCODED_LEN: usize = 146usize;
23147 pub const DEFAULT: Self = Self {
23148 param_id: CharArray::new([0_u8; 16usize]),
23149 param_value: CharArray::new([0_u8; 128usize]),
23150 param_type: MavParamExtType::DEFAULT,
23151 param_result: ParamAck::DEFAULT,
23152 };
23153 #[cfg(feature = "arbitrary")]
23154 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23155 use arbitrary::{Arbitrary, Unstructured};
23156 let mut buf = [0u8; 1024];
23157 rng.fill_bytes(&mut buf);
23158 let mut unstructured = Unstructured::new(&buf);
23159 Self::arbitrary(&mut unstructured).unwrap_or_default()
23160 }
23161}
23162impl Default for PARAM_EXT_ACK_DATA {
23163 fn default() -> Self {
23164 Self::DEFAULT.clone()
23165 }
23166}
23167impl MessageData for PARAM_EXT_ACK_DATA {
23168 type Message = MavMessage;
23169 const ID: u32 = 324u32;
23170 const NAME: &'static str = "PARAM_EXT_ACK";
23171 const EXTRA_CRC: u8 = 132u8;
23172 const ENCODED_LEN: usize = 146usize;
23173 fn deser(
23174 _version: MavlinkVersion,
23175 __input: &[u8],
23176 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23177 let avail_len = __input.len();
23178 let mut payload_buf = [0; Self::ENCODED_LEN];
23179 let mut buf = if avail_len < Self::ENCODED_LEN {
23180 payload_buf[0..avail_len].copy_from_slice(__input);
23181 Bytes::new(&payload_buf)
23182 } else {
23183 Bytes::new(__input)
23184 };
23185 let mut __struct = Self::default();
23186 let mut tmp = [0_u8; 16usize];
23187 for v in &mut tmp {
23188 *v = buf.get_u8();
23189 }
23190 __struct.param_id = CharArray::new(tmp);
23191 let mut tmp = [0_u8; 128usize];
23192 for v in &mut tmp {
23193 *v = buf.get_u8();
23194 }
23195 __struct.param_value = CharArray::new(tmp);
23196 let tmp = buf.get_u8();
23197 __struct.param_type =
23198 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23199 enum_type: "MavParamExtType",
23200 value: tmp as u64,
23201 })?;
23202 let tmp = buf.get_u8();
23203 __struct.param_result =
23204 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23205 enum_type: "ParamAck",
23206 value: tmp as u64,
23207 })?;
23208 Ok(__struct)
23209 }
23210 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23211 let mut __tmp = BytesMut::new(bytes);
23212 #[allow(clippy::absurd_extreme_comparisons)]
23213 #[allow(unused_comparisons)]
23214 if __tmp.remaining() < Self::ENCODED_LEN {
23215 panic!(
23216 "buffer is too small (need {} bytes, but got {})",
23217 Self::ENCODED_LEN,
23218 __tmp.remaining(),
23219 )
23220 }
23221 for val in &self.param_id {
23222 __tmp.put_u8(*val);
23223 }
23224 for val in &self.param_value {
23225 __tmp.put_u8(*val);
23226 }
23227 __tmp.put_u8(self.param_type as u8);
23228 __tmp.put_u8(self.param_result as u8);
23229 if matches!(version, MavlinkVersion::V2) {
23230 let len = __tmp.len();
23231 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23232 } else {
23233 __tmp.len()
23234 }
23235 }
23236}
23237#[doc = "Request all parameters of this component. All parameters should be emitted in response as PARAM_EXT_VALUE."]
23238#[doc = ""]
23239#[doc = "ID: 321"]
23240#[derive(Debug, Clone, PartialEq)]
23241#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23242#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23243#[cfg_attr(feature = "ts", derive(TS))]
23244#[cfg_attr(feature = "ts", ts(export))]
23245pub struct PARAM_EXT_REQUEST_LIST_DATA {
23246 #[doc = "System ID"]
23247 pub target_system: u8,
23248 #[doc = "Component ID"]
23249 pub target_component: u8,
23250}
23251impl PARAM_EXT_REQUEST_LIST_DATA {
23252 pub const ENCODED_LEN: usize = 2usize;
23253 pub const DEFAULT: Self = Self {
23254 target_system: 0_u8,
23255 target_component: 0_u8,
23256 };
23257 #[cfg(feature = "arbitrary")]
23258 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23259 use arbitrary::{Arbitrary, Unstructured};
23260 let mut buf = [0u8; 1024];
23261 rng.fill_bytes(&mut buf);
23262 let mut unstructured = Unstructured::new(&buf);
23263 Self::arbitrary(&mut unstructured).unwrap_or_default()
23264 }
23265}
23266impl Default for PARAM_EXT_REQUEST_LIST_DATA {
23267 fn default() -> Self {
23268 Self::DEFAULT.clone()
23269 }
23270}
23271impl MessageData for PARAM_EXT_REQUEST_LIST_DATA {
23272 type Message = MavMessage;
23273 const ID: u32 = 321u32;
23274 const NAME: &'static str = "PARAM_EXT_REQUEST_LIST";
23275 const EXTRA_CRC: u8 = 88u8;
23276 const ENCODED_LEN: usize = 2usize;
23277 fn deser(
23278 _version: MavlinkVersion,
23279 __input: &[u8],
23280 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23281 let avail_len = __input.len();
23282 let mut payload_buf = [0; Self::ENCODED_LEN];
23283 let mut buf = if avail_len < Self::ENCODED_LEN {
23284 payload_buf[0..avail_len].copy_from_slice(__input);
23285 Bytes::new(&payload_buf)
23286 } else {
23287 Bytes::new(__input)
23288 };
23289 let mut __struct = Self::default();
23290 __struct.target_system = buf.get_u8();
23291 __struct.target_component = buf.get_u8();
23292 Ok(__struct)
23293 }
23294 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23295 let mut __tmp = BytesMut::new(bytes);
23296 #[allow(clippy::absurd_extreme_comparisons)]
23297 #[allow(unused_comparisons)]
23298 if __tmp.remaining() < Self::ENCODED_LEN {
23299 panic!(
23300 "buffer is too small (need {} bytes, but got {})",
23301 Self::ENCODED_LEN,
23302 __tmp.remaining(),
23303 )
23304 }
23305 __tmp.put_u8(self.target_system);
23306 __tmp.put_u8(self.target_component);
23307 if matches!(version, MavlinkVersion::V2) {
23308 let len = __tmp.len();
23309 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23310 } else {
23311 __tmp.len()
23312 }
23313 }
23314}
23315#[doc = "Request to read the value of a parameter with either the param_id string id or param_index. PARAM_EXT_VALUE should be emitted in response."]
23316#[doc = ""]
23317#[doc = "ID: 320"]
23318#[derive(Debug, Clone, PartialEq)]
23319#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23320#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23321#[cfg_attr(feature = "ts", derive(TS))]
23322#[cfg_attr(feature = "ts", ts(export))]
23323pub struct PARAM_EXT_REQUEST_READ_DATA {
23324 #[doc = "Parameter index. Set to -1 to use the Parameter ID field as identifier (else param_id will be ignored)"]
23325 pub param_index: i16,
23326 #[doc = "System ID"]
23327 pub target_system: u8,
23328 #[doc = "Component ID"]
23329 pub target_component: u8,
23330 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23331 #[cfg_attr(feature = "ts", ts(type = "string"))]
23332 pub param_id: CharArray<16>,
23333}
23334impl PARAM_EXT_REQUEST_READ_DATA {
23335 pub const ENCODED_LEN: usize = 20usize;
23336 pub const DEFAULT: Self = Self {
23337 param_index: 0_i16,
23338 target_system: 0_u8,
23339 target_component: 0_u8,
23340 param_id: CharArray::new([0_u8; 16usize]),
23341 };
23342 #[cfg(feature = "arbitrary")]
23343 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23344 use arbitrary::{Arbitrary, Unstructured};
23345 let mut buf = [0u8; 1024];
23346 rng.fill_bytes(&mut buf);
23347 let mut unstructured = Unstructured::new(&buf);
23348 Self::arbitrary(&mut unstructured).unwrap_or_default()
23349 }
23350}
23351impl Default for PARAM_EXT_REQUEST_READ_DATA {
23352 fn default() -> Self {
23353 Self::DEFAULT.clone()
23354 }
23355}
23356impl MessageData for PARAM_EXT_REQUEST_READ_DATA {
23357 type Message = MavMessage;
23358 const ID: u32 = 320u32;
23359 const NAME: &'static str = "PARAM_EXT_REQUEST_READ";
23360 const EXTRA_CRC: u8 = 243u8;
23361 const ENCODED_LEN: usize = 20usize;
23362 fn deser(
23363 _version: MavlinkVersion,
23364 __input: &[u8],
23365 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23366 let avail_len = __input.len();
23367 let mut payload_buf = [0; Self::ENCODED_LEN];
23368 let mut buf = if avail_len < Self::ENCODED_LEN {
23369 payload_buf[0..avail_len].copy_from_slice(__input);
23370 Bytes::new(&payload_buf)
23371 } else {
23372 Bytes::new(__input)
23373 };
23374 let mut __struct = Self::default();
23375 __struct.param_index = buf.get_i16_le();
23376 __struct.target_system = buf.get_u8();
23377 __struct.target_component = buf.get_u8();
23378 let mut tmp = [0_u8; 16usize];
23379 for v in &mut tmp {
23380 *v = buf.get_u8();
23381 }
23382 __struct.param_id = CharArray::new(tmp);
23383 Ok(__struct)
23384 }
23385 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23386 let mut __tmp = BytesMut::new(bytes);
23387 #[allow(clippy::absurd_extreme_comparisons)]
23388 #[allow(unused_comparisons)]
23389 if __tmp.remaining() < Self::ENCODED_LEN {
23390 panic!(
23391 "buffer is too small (need {} bytes, but got {})",
23392 Self::ENCODED_LEN,
23393 __tmp.remaining(),
23394 )
23395 }
23396 __tmp.put_i16_le(self.param_index);
23397 __tmp.put_u8(self.target_system);
23398 __tmp.put_u8(self.target_component);
23399 for val in &self.param_id {
23400 __tmp.put_u8(*val);
23401 }
23402 if matches!(version, MavlinkVersion::V2) {
23403 let len = __tmp.len();
23404 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23405 } else {
23406 __tmp.len()
23407 }
23408 }
23409}
23410#[doc = "Set a parameter value. In order to deal with message loss (and retransmission of PARAM_EXT_SET), when setting a parameter value and the new value is the same as the current value, you will immediately get a PARAM_ACK_ACCEPTED response. If the current state is PARAM_ACK_IN_PROGRESS, you will accordingly receive a PARAM_ACK_IN_PROGRESS in response."]
23411#[doc = ""]
23412#[doc = "ID: 323"]
23413#[derive(Debug, Clone, PartialEq)]
23414#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23415#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23416#[cfg_attr(feature = "ts", derive(TS))]
23417#[cfg_attr(feature = "ts", ts(export))]
23418pub struct PARAM_EXT_SET_DATA {
23419 #[doc = "System ID"]
23420 pub target_system: u8,
23421 #[doc = "Component ID"]
23422 pub target_component: u8,
23423 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23424 #[cfg_attr(feature = "ts", ts(type = "string"))]
23425 pub param_id: CharArray<16>,
23426 #[doc = "Parameter value"]
23427 #[cfg_attr(feature = "ts", ts(type = "string"))]
23428 pub param_value: CharArray<128>,
23429 #[doc = "Parameter type."]
23430 pub param_type: MavParamExtType,
23431}
23432impl PARAM_EXT_SET_DATA {
23433 pub const ENCODED_LEN: usize = 147usize;
23434 pub const DEFAULT: Self = Self {
23435 target_system: 0_u8,
23436 target_component: 0_u8,
23437 param_id: CharArray::new([0_u8; 16usize]),
23438 param_value: CharArray::new([0_u8; 128usize]),
23439 param_type: MavParamExtType::DEFAULT,
23440 };
23441 #[cfg(feature = "arbitrary")]
23442 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23443 use arbitrary::{Arbitrary, Unstructured};
23444 let mut buf = [0u8; 1024];
23445 rng.fill_bytes(&mut buf);
23446 let mut unstructured = Unstructured::new(&buf);
23447 Self::arbitrary(&mut unstructured).unwrap_or_default()
23448 }
23449}
23450impl Default for PARAM_EXT_SET_DATA {
23451 fn default() -> Self {
23452 Self::DEFAULT.clone()
23453 }
23454}
23455impl MessageData for PARAM_EXT_SET_DATA {
23456 type Message = MavMessage;
23457 const ID: u32 = 323u32;
23458 const NAME: &'static str = "PARAM_EXT_SET";
23459 const EXTRA_CRC: u8 = 78u8;
23460 const ENCODED_LEN: usize = 147usize;
23461 fn deser(
23462 _version: MavlinkVersion,
23463 __input: &[u8],
23464 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23465 let avail_len = __input.len();
23466 let mut payload_buf = [0; Self::ENCODED_LEN];
23467 let mut buf = if avail_len < Self::ENCODED_LEN {
23468 payload_buf[0..avail_len].copy_from_slice(__input);
23469 Bytes::new(&payload_buf)
23470 } else {
23471 Bytes::new(__input)
23472 };
23473 let mut __struct = Self::default();
23474 __struct.target_system = buf.get_u8();
23475 __struct.target_component = buf.get_u8();
23476 let mut tmp = [0_u8; 16usize];
23477 for v in &mut tmp {
23478 *v = buf.get_u8();
23479 }
23480 __struct.param_id = CharArray::new(tmp);
23481 let mut tmp = [0_u8; 128usize];
23482 for v in &mut tmp {
23483 *v = buf.get_u8();
23484 }
23485 __struct.param_value = CharArray::new(tmp);
23486 let tmp = buf.get_u8();
23487 __struct.param_type =
23488 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23489 enum_type: "MavParamExtType",
23490 value: tmp as u64,
23491 })?;
23492 Ok(__struct)
23493 }
23494 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23495 let mut __tmp = BytesMut::new(bytes);
23496 #[allow(clippy::absurd_extreme_comparisons)]
23497 #[allow(unused_comparisons)]
23498 if __tmp.remaining() < Self::ENCODED_LEN {
23499 panic!(
23500 "buffer is too small (need {} bytes, but got {})",
23501 Self::ENCODED_LEN,
23502 __tmp.remaining(),
23503 )
23504 }
23505 __tmp.put_u8(self.target_system);
23506 __tmp.put_u8(self.target_component);
23507 for val in &self.param_id {
23508 __tmp.put_u8(*val);
23509 }
23510 for val in &self.param_value {
23511 __tmp.put_u8(*val);
23512 }
23513 __tmp.put_u8(self.param_type as u8);
23514 if matches!(version, MavlinkVersion::V2) {
23515 let len = __tmp.len();
23516 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23517 } else {
23518 __tmp.len()
23519 }
23520 }
23521}
23522#[doc = "Emit the value of a parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows them to re-request missing parameters after a loss or timeout."]
23523#[doc = ""]
23524#[doc = "ID: 322"]
23525#[derive(Debug, Clone, PartialEq)]
23526#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23527#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23528#[cfg_attr(feature = "ts", derive(TS))]
23529#[cfg_attr(feature = "ts", ts(export))]
23530pub struct PARAM_EXT_VALUE_DATA {
23531 #[doc = "Total number of parameters"]
23532 pub param_count: u16,
23533 #[doc = "Index of this parameter"]
23534 pub param_index: u16,
23535 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23536 #[cfg_attr(feature = "ts", ts(type = "string"))]
23537 pub param_id: CharArray<16>,
23538 #[doc = "Parameter value"]
23539 #[cfg_attr(feature = "ts", ts(type = "string"))]
23540 pub param_value: CharArray<128>,
23541 #[doc = "Parameter type."]
23542 pub param_type: MavParamExtType,
23543}
23544impl PARAM_EXT_VALUE_DATA {
23545 pub const ENCODED_LEN: usize = 149usize;
23546 pub const DEFAULT: Self = Self {
23547 param_count: 0_u16,
23548 param_index: 0_u16,
23549 param_id: CharArray::new([0_u8; 16usize]),
23550 param_value: CharArray::new([0_u8; 128usize]),
23551 param_type: MavParamExtType::DEFAULT,
23552 };
23553 #[cfg(feature = "arbitrary")]
23554 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23555 use arbitrary::{Arbitrary, Unstructured};
23556 let mut buf = [0u8; 1024];
23557 rng.fill_bytes(&mut buf);
23558 let mut unstructured = Unstructured::new(&buf);
23559 Self::arbitrary(&mut unstructured).unwrap_or_default()
23560 }
23561}
23562impl Default for PARAM_EXT_VALUE_DATA {
23563 fn default() -> Self {
23564 Self::DEFAULT.clone()
23565 }
23566}
23567impl MessageData for PARAM_EXT_VALUE_DATA {
23568 type Message = MavMessage;
23569 const ID: u32 = 322u32;
23570 const NAME: &'static str = "PARAM_EXT_VALUE";
23571 const EXTRA_CRC: u8 = 243u8;
23572 const ENCODED_LEN: usize = 149usize;
23573 fn deser(
23574 _version: MavlinkVersion,
23575 __input: &[u8],
23576 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23577 let avail_len = __input.len();
23578 let mut payload_buf = [0; Self::ENCODED_LEN];
23579 let mut buf = if avail_len < Self::ENCODED_LEN {
23580 payload_buf[0..avail_len].copy_from_slice(__input);
23581 Bytes::new(&payload_buf)
23582 } else {
23583 Bytes::new(__input)
23584 };
23585 let mut __struct = Self::default();
23586 __struct.param_count = buf.get_u16_le();
23587 __struct.param_index = buf.get_u16_le();
23588 let mut tmp = [0_u8; 16usize];
23589 for v in &mut tmp {
23590 *v = buf.get_u8();
23591 }
23592 __struct.param_id = CharArray::new(tmp);
23593 let mut tmp = [0_u8; 128usize];
23594 for v in &mut tmp {
23595 *v = buf.get_u8();
23596 }
23597 __struct.param_value = CharArray::new(tmp);
23598 let tmp = buf.get_u8();
23599 __struct.param_type =
23600 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23601 enum_type: "MavParamExtType",
23602 value: tmp as u64,
23603 })?;
23604 Ok(__struct)
23605 }
23606 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23607 let mut __tmp = BytesMut::new(bytes);
23608 #[allow(clippy::absurd_extreme_comparisons)]
23609 #[allow(unused_comparisons)]
23610 if __tmp.remaining() < Self::ENCODED_LEN {
23611 panic!(
23612 "buffer is too small (need {} bytes, but got {})",
23613 Self::ENCODED_LEN,
23614 __tmp.remaining(),
23615 )
23616 }
23617 __tmp.put_u16_le(self.param_count);
23618 __tmp.put_u16_le(self.param_index);
23619 for val in &self.param_id {
23620 __tmp.put_u8(*val);
23621 }
23622 for val in &self.param_value {
23623 __tmp.put_u8(*val);
23624 }
23625 __tmp.put_u8(self.param_type as u8);
23626 if matches!(version, MavlinkVersion::V2) {
23627 let len = __tmp.len();
23628 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23629 } else {
23630 __tmp.len()
23631 }
23632 }
23633}
23634#[doc = "Bind a RC channel to a parameter. The parameter should change according to the RC channel value."]
23635#[doc = ""]
23636#[doc = "ID: 50"]
23637#[derive(Debug, Clone, PartialEq)]
23638#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23639#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23640#[cfg_attr(feature = "ts", derive(TS))]
23641#[cfg_attr(feature = "ts", ts(export))]
23642pub struct PARAM_MAP_RC_DATA {
23643 #[doc = "Initial parameter value"]
23644 pub param_value0: f32,
23645 #[doc = "Scale, maps the RC range [-1, 1] to a parameter value"]
23646 pub scale: f32,
23647 #[doc = "Minimum param value. The protocol does not define if this overwrites an onboard minimum value. (Depends on implementation)"]
23648 pub param_value_min: f32,
23649 #[doc = "Maximum param value. The protocol does not define if this overwrites an onboard maximum value. (Depends on implementation)"]
23650 pub param_value_max: f32,
23651 #[doc = "Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored), send -2 to disable any existing map for this rc_channel_index."]
23652 pub param_index: i16,
23653 #[doc = "System ID"]
23654 pub target_system: u8,
23655 #[doc = "Component ID"]
23656 pub target_component: u8,
23657 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23658 #[cfg_attr(feature = "ts", ts(type = "string"))]
23659 pub param_id: CharArray<16>,
23660 #[doc = "Index of parameter RC channel. Not equal to the RC channel id. Typically corresponds to a potentiometer-knob on the RC."]
23661 pub parameter_rc_channel_index: u8,
23662}
23663impl PARAM_MAP_RC_DATA {
23664 pub const ENCODED_LEN: usize = 37usize;
23665 pub const DEFAULT: Self = Self {
23666 param_value0: 0.0_f32,
23667 scale: 0.0_f32,
23668 param_value_min: 0.0_f32,
23669 param_value_max: 0.0_f32,
23670 param_index: 0_i16,
23671 target_system: 0_u8,
23672 target_component: 0_u8,
23673 param_id: CharArray::new([0_u8; 16usize]),
23674 parameter_rc_channel_index: 0_u8,
23675 };
23676 #[cfg(feature = "arbitrary")]
23677 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23678 use arbitrary::{Arbitrary, Unstructured};
23679 let mut buf = [0u8; 1024];
23680 rng.fill_bytes(&mut buf);
23681 let mut unstructured = Unstructured::new(&buf);
23682 Self::arbitrary(&mut unstructured).unwrap_or_default()
23683 }
23684}
23685impl Default for PARAM_MAP_RC_DATA {
23686 fn default() -> Self {
23687 Self::DEFAULT.clone()
23688 }
23689}
23690impl MessageData for PARAM_MAP_RC_DATA {
23691 type Message = MavMessage;
23692 const ID: u32 = 50u32;
23693 const NAME: &'static str = "PARAM_MAP_RC";
23694 const EXTRA_CRC: u8 = 78u8;
23695 const ENCODED_LEN: usize = 37usize;
23696 fn deser(
23697 _version: MavlinkVersion,
23698 __input: &[u8],
23699 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23700 let avail_len = __input.len();
23701 let mut payload_buf = [0; Self::ENCODED_LEN];
23702 let mut buf = if avail_len < Self::ENCODED_LEN {
23703 payload_buf[0..avail_len].copy_from_slice(__input);
23704 Bytes::new(&payload_buf)
23705 } else {
23706 Bytes::new(__input)
23707 };
23708 let mut __struct = Self::default();
23709 __struct.param_value0 = buf.get_f32_le();
23710 __struct.scale = buf.get_f32_le();
23711 __struct.param_value_min = buf.get_f32_le();
23712 __struct.param_value_max = buf.get_f32_le();
23713 __struct.param_index = buf.get_i16_le();
23714 __struct.target_system = buf.get_u8();
23715 __struct.target_component = buf.get_u8();
23716 let mut tmp = [0_u8; 16usize];
23717 for v in &mut tmp {
23718 *v = buf.get_u8();
23719 }
23720 __struct.param_id = CharArray::new(tmp);
23721 __struct.parameter_rc_channel_index = buf.get_u8();
23722 Ok(__struct)
23723 }
23724 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23725 let mut __tmp = BytesMut::new(bytes);
23726 #[allow(clippy::absurd_extreme_comparisons)]
23727 #[allow(unused_comparisons)]
23728 if __tmp.remaining() < Self::ENCODED_LEN {
23729 panic!(
23730 "buffer is too small (need {} bytes, but got {})",
23731 Self::ENCODED_LEN,
23732 __tmp.remaining(),
23733 )
23734 }
23735 __tmp.put_f32_le(self.param_value0);
23736 __tmp.put_f32_le(self.scale);
23737 __tmp.put_f32_le(self.param_value_min);
23738 __tmp.put_f32_le(self.param_value_max);
23739 __tmp.put_i16_le(self.param_index);
23740 __tmp.put_u8(self.target_system);
23741 __tmp.put_u8(self.target_component);
23742 for val in &self.param_id {
23743 __tmp.put_u8(*val);
23744 }
23745 __tmp.put_u8(self.parameter_rc_channel_index);
23746 if matches!(version, MavlinkVersion::V2) {
23747 let len = __tmp.len();
23748 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23749 } else {
23750 __tmp.len()
23751 }
23752 }
23753}
23754#[doc = "Request all parameters of this component. After this request, all parameters are emitted. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
23755#[doc = ""]
23756#[doc = "ID: 21"]
23757#[derive(Debug, Clone, PartialEq)]
23758#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23759#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23760#[cfg_attr(feature = "ts", derive(TS))]
23761#[cfg_attr(feature = "ts", ts(export))]
23762pub struct PARAM_REQUEST_LIST_DATA {
23763 #[doc = "System ID"]
23764 pub target_system: u8,
23765 #[doc = "Component ID"]
23766 pub target_component: u8,
23767}
23768impl PARAM_REQUEST_LIST_DATA {
23769 pub const ENCODED_LEN: usize = 2usize;
23770 pub const DEFAULT: Self = Self {
23771 target_system: 0_u8,
23772 target_component: 0_u8,
23773 };
23774 #[cfg(feature = "arbitrary")]
23775 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23776 use arbitrary::{Arbitrary, Unstructured};
23777 let mut buf = [0u8; 1024];
23778 rng.fill_bytes(&mut buf);
23779 let mut unstructured = Unstructured::new(&buf);
23780 Self::arbitrary(&mut unstructured).unwrap_or_default()
23781 }
23782}
23783impl Default for PARAM_REQUEST_LIST_DATA {
23784 fn default() -> Self {
23785 Self::DEFAULT.clone()
23786 }
23787}
23788impl MessageData for PARAM_REQUEST_LIST_DATA {
23789 type Message = MavMessage;
23790 const ID: u32 = 21u32;
23791 const NAME: &'static str = "PARAM_REQUEST_LIST";
23792 const EXTRA_CRC: u8 = 159u8;
23793 const ENCODED_LEN: usize = 2usize;
23794 fn deser(
23795 _version: MavlinkVersion,
23796 __input: &[u8],
23797 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23798 let avail_len = __input.len();
23799 let mut payload_buf = [0; Self::ENCODED_LEN];
23800 let mut buf = if avail_len < Self::ENCODED_LEN {
23801 payload_buf[0..avail_len].copy_from_slice(__input);
23802 Bytes::new(&payload_buf)
23803 } else {
23804 Bytes::new(__input)
23805 };
23806 let mut __struct = Self::default();
23807 __struct.target_system = buf.get_u8();
23808 __struct.target_component = buf.get_u8();
23809 Ok(__struct)
23810 }
23811 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23812 let mut __tmp = BytesMut::new(bytes);
23813 #[allow(clippy::absurd_extreme_comparisons)]
23814 #[allow(unused_comparisons)]
23815 if __tmp.remaining() < Self::ENCODED_LEN {
23816 panic!(
23817 "buffer is too small (need {} bytes, but got {})",
23818 Self::ENCODED_LEN,
23819 __tmp.remaining(),
23820 )
23821 }
23822 __tmp.put_u8(self.target_system);
23823 __tmp.put_u8(self.target_component);
23824 if matches!(version, MavlinkVersion::V2) {
23825 let len = __tmp.len();
23826 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23827 } else {
23828 __tmp.len()
23829 }
23830 }
23831}
23832#[doc = "value[float]. This allows to send a parameter to any other component (such as the GCS) without the need of previous knowledge of possible parameter names. Thus the same GCS can store different parameters for different autopilots. See also <https://mavlink.io/en/services/parameter.html> for a full documentation of QGroundControl and IMU code."]
23833#[doc = ""]
23834#[doc = "ID: 20"]
23835#[derive(Debug, Clone, PartialEq)]
23836#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23837#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23838#[cfg_attr(feature = "ts", derive(TS))]
23839#[cfg_attr(feature = "ts", ts(export))]
23840pub struct PARAM_REQUEST_READ_DATA {
23841 #[doc = "Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored)"]
23842 pub param_index: i16,
23843 #[doc = "System ID"]
23844 pub target_system: u8,
23845 #[doc = "Component ID"]
23846 pub target_component: u8,
23847 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23848 #[cfg_attr(feature = "ts", ts(type = "string"))]
23849 pub param_id: CharArray<16>,
23850}
23851impl PARAM_REQUEST_READ_DATA {
23852 pub const ENCODED_LEN: usize = 20usize;
23853 pub const DEFAULT: Self = Self {
23854 param_index: 0_i16,
23855 target_system: 0_u8,
23856 target_component: 0_u8,
23857 param_id: CharArray::new([0_u8; 16usize]),
23858 };
23859 #[cfg(feature = "arbitrary")]
23860 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23861 use arbitrary::{Arbitrary, Unstructured};
23862 let mut buf = [0u8; 1024];
23863 rng.fill_bytes(&mut buf);
23864 let mut unstructured = Unstructured::new(&buf);
23865 Self::arbitrary(&mut unstructured).unwrap_or_default()
23866 }
23867}
23868impl Default for PARAM_REQUEST_READ_DATA {
23869 fn default() -> Self {
23870 Self::DEFAULT.clone()
23871 }
23872}
23873impl MessageData for PARAM_REQUEST_READ_DATA {
23874 type Message = MavMessage;
23875 const ID: u32 = 20u32;
23876 const NAME: &'static str = "PARAM_REQUEST_READ";
23877 const EXTRA_CRC: u8 = 214u8;
23878 const ENCODED_LEN: usize = 20usize;
23879 fn deser(
23880 _version: MavlinkVersion,
23881 __input: &[u8],
23882 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23883 let avail_len = __input.len();
23884 let mut payload_buf = [0; Self::ENCODED_LEN];
23885 let mut buf = if avail_len < Self::ENCODED_LEN {
23886 payload_buf[0..avail_len].copy_from_slice(__input);
23887 Bytes::new(&payload_buf)
23888 } else {
23889 Bytes::new(__input)
23890 };
23891 let mut __struct = Self::default();
23892 __struct.param_index = buf.get_i16_le();
23893 __struct.target_system = buf.get_u8();
23894 __struct.target_component = buf.get_u8();
23895 let mut tmp = [0_u8; 16usize];
23896 for v in &mut tmp {
23897 *v = buf.get_u8();
23898 }
23899 __struct.param_id = CharArray::new(tmp);
23900 Ok(__struct)
23901 }
23902 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23903 let mut __tmp = BytesMut::new(bytes);
23904 #[allow(clippy::absurd_extreme_comparisons)]
23905 #[allow(unused_comparisons)]
23906 if __tmp.remaining() < Self::ENCODED_LEN {
23907 panic!(
23908 "buffer is too small (need {} bytes, but got {})",
23909 Self::ENCODED_LEN,
23910 __tmp.remaining(),
23911 )
23912 }
23913 __tmp.put_i16_le(self.param_index);
23914 __tmp.put_u8(self.target_system);
23915 __tmp.put_u8(self.target_component);
23916 for val in &self.param_id {
23917 __tmp.put_u8(*val);
23918 }
23919 if matches!(version, MavlinkVersion::V2) {
23920 let len = __tmp.len();
23921 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23922 } else {
23923 __tmp.len()
23924 }
23925 }
23926}
23927#[doc = "Set a parameter value (write new value to permanent storage). The receiving component should acknowledge the new parameter value by broadcasting a PARAM_VALUE message (broadcasting ensures that multiple GCS all have an up-to-date list of all parameters). If the sending GCS did not receive a PARAM_VALUE within its timeout time, it should re-send the PARAM_SET message. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
23928#[doc = ""]
23929#[doc = "ID: 23"]
23930#[derive(Debug, Clone, PartialEq)]
23931#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23932#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23933#[cfg_attr(feature = "ts", derive(TS))]
23934#[cfg_attr(feature = "ts", ts(export))]
23935pub struct PARAM_SET_DATA {
23936 #[doc = "Onboard parameter value"]
23937 pub param_value: f32,
23938 #[doc = "System ID"]
23939 pub target_system: u8,
23940 #[doc = "Component ID"]
23941 pub target_component: u8,
23942 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23943 #[cfg_attr(feature = "ts", ts(type = "string"))]
23944 pub param_id: CharArray<16>,
23945 #[doc = "Onboard parameter type."]
23946 pub param_type: MavParamType,
23947}
23948impl PARAM_SET_DATA {
23949 pub const ENCODED_LEN: usize = 23usize;
23950 pub const DEFAULT: Self = Self {
23951 param_value: 0.0_f32,
23952 target_system: 0_u8,
23953 target_component: 0_u8,
23954 param_id: CharArray::new([0_u8; 16usize]),
23955 param_type: MavParamType::DEFAULT,
23956 };
23957 #[cfg(feature = "arbitrary")]
23958 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23959 use arbitrary::{Arbitrary, Unstructured};
23960 let mut buf = [0u8; 1024];
23961 rng.fill_bytes(&mut buf);
23962 let mut unstructured = Unstructured::new(&buf);
23963 Self::arbitrary(&mut unstructured).unwrap_or_default()
23964 }
23965}
23966impl Default for PARAM_SET_DATA {
23967 fn default() -> Self {
23968 Self::DEFAULT.clone()
23969 }
23970}
23971impl MessageData for PARAM_SET_DATA {
23972 type Message = MavMessage;
23973 const ID: u32 = 23u32;
23974 const NAME: &'static str = "PARAM_SET";
23975 const EXTRA_CRC: u8 = 168u8;
23976 const ENCODED_LEN: usize = 23usize;
23977 fn deser(
23978 _version: MavlinkVersion,
23979 __input: &[u8],
23980 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23981 let avail_len = __input.len();
23982 let mut payload_buf = [0; Self::ENCODED_LEN];
23983 let mut buf = if avail_len < Self::ENCODED_LEN {
23984 payload_buf[0..avail_len].copy_from_slice(__input);
23985 Bytes::new(&payload_buf)
23986 } else {
23987 Bytes::new(__input)
23988 };
23989 let mut __struct = Self::default();
23990 __struct.param_value = buf.get_f32_le();
23991 __struct.target_system = buf.get_u8();
23992 __struct.target_component = buf.get_u8();
23993 let mut tmp = [0_u8; 16usize];
23994 for v in &mut tmp {
23995 *v = buf.get_u8();
23996 }
23997 __struct.param_id = CharArray::new(tmp);
23998 let tmp = buf.get_u8();
23999 __struct.param_type =
24000 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24001 enum_type: "MavParamType",
24002 value: tmp as u64,
24003 })?;
24004 Ok(__struct)
24005 }
24006 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24007 let mut __tmp = BytesMut::new(bytes);
24008 #[allow(clippy::absurd_extreme_comparisons)]
24009 #[allow(unused_comparisons)]
24010 if __tmp.remaining() < Self::ENCODED_LEN {
24011 panic!(
24012 "buffer is too small (need {} bytes, but got {})",
24013 Self::ENCODED_LEN,
24014 __tmp.remaining(),
24015 )
24016 }
24017 __tmp.put_f32_le(self.param_value);
24018 __tmp.put_u8(self.target_system);
24019 __tmp.put_u8(self.target_component);
24020 for val in &self.param_id {
24021 __tmp.put_u8(*val);
24022 }
24023 __tmp.put_u8(self.param_type as u8);
24024 if matches!(version, MavlinkVersion::V2) {
24025 let len = __tmp.len();
24026 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24027 } else {
24028 __tmp.len()
24029 }
24030 }
24031}
24032#[doc = "Emit the value of a onboard parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows him to re-request missing parameters after a loss or timeout. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
24033#[doc = ""]
24034#[doc = "ID: 22"]
24035#[derive(Debug, Clone, PartialEq)]
24036#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24037#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24038#[cfg_attr(feature = "ts", derive(TS))]
24039#[cfg_attr(feature = "ts", ts(export))]
24040pub struct PARAM_VALUE_DATA {
24041 #[doc = "Onboard parameter value"]
24042 pub param_value: f32,
24043 #[doc = "Total number of onboard parameters"]
24044 pub param_count: u16,
24045 #[doc = "Index of this onboard parameter"]
24046 pub param_index: u16,
24047 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
24048 #[cfg_attr(feature = "ts", ts(type = "string"))]
24049 pub param_id: CharArray<16>,
24050 #[doc = "Onboard parameter type."]
24051 pub param_type: MavParamType,
24052}
24053impl PARAM_VALUE_DATA {
24054 pub const ENCODED_LEN: usize = 25usize;
24055 pub const DEFAULT: Self = Self {
24056 param_value: 0.0_f32,
24057 param_count: 0_u16,
24058 param_index: 0_u16,
24059 param_id: CharArray::new([0_u8; 16usize]),
24060 param_type: MavParamType::DEFAULT,
24061 };
24062 #[cfg(feature = "arbitrary")]
24063 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24064 use arbitrary::{Arbitrary, Unstructured};
24065 let mut buf = [0u8; 1024];
24066 rng.fill_bytes(&mut buf);
24067 let mut unstructured = Unstructured::new(&buf);
24068 Self::arbitrary(&mut unstructured).unwrap_or_default()
24069 }
24070}
24071impl Default for PARAM_VALUE_DATA {
24072 fn default() -> Self {
24073 Self::DEFAULT.clone()
24074 }
24075}
24076impl MessageData for PARAM_VALUE_DATA {
24077 type Message = MavMessage;
24078 const ID: u32 = 22u32;
24079 const NAME: &'static str = "PARAM_VALUE";
24080 const EXTRA_CRC: u8 = 220u8;
24081 const ENCODED_LEN: usize = 25usize;
24082 fn deser(
24083 _version: MavlinkVersion,
24084 __input: &[u8],
24085 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24086 let avail_len = __input.len();
24087 let mut payload_buf = [0; Self::ENCODED_LEN];
24088 let mut buf = if avail_len < Self::ENCODED_LEN {
24089 payload_buf[0..avail_len].copy_from_slice(__input);
24090 Bytes::new(&payload_buf)
24091 } else {
24092 Bytes::new(__input)
24093 };
24094 let mut __struct = Self::default();
24095 __struct.param_value = buf.get_f32_le();
24096 __struct.param_count = buf.get_u16_le();
24097 __struct.param_index = buf.get_u16_le();
24098 let mut tmp = [0_u8; 16usize];
24099 for v in &mut tmp {
24100 *v = buf.get_u8();
24101 }
24102 __struct.param_id = CharArray::new(tmp);
24103 let tmp = buf.get_u8();
24104 __struct.param_type =
24105 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24106 enum_type: "MavParamType",
24107 value: tmp as u64,
24108 })?;
24109 Ok(__struct)
24110 }
24111 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24112 let mut __tmp = BytesMut::new(bytes);
24113 #[allow(clippy::absurd_extreme_comparisons)]
24114 #[allow(unused_comparisons)]
24115 if __tmp.remaining() < Self::ENCODED_LEN {
24116 panic!(
24117 "buffer is too small (need {} bytes, but got {})",
24118 Self::ENCODED_LEN,
24119 __tmp.remaining(),
24120 )
24121 }
24122 __tmp.put_f32_le(self.param_value);
24123 __tmp.put_u16_le(self.param_count);
24124 __tmp.put_u16_le(self.param_index);
24125 for val in &self.param_id {
24126 __tmp.put_u8(*val);
24127 }
24128 __tmp.put_u8(self.param_type as u8);
24129 if matches!(version, MavlinkVersion::V2) {
24130 let len = __tmp.len();
24131 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24132 } else {
24133 __tmp.len()
24134 }
24135 }
24136}
24137#[deprecated = "To be removed / merged with TIMESYNC. See `TIMESYNC` (Deprecated since 2011-08)"]
24138#[doc = "A ping message either requesting or responding to a ping. This allows to measure the system latencies, including serial port, radio modem and UDP connections. The ping microservice is documented at <https://mavlink.io/en/services/ping.html>."]
24139#[doc = ""]
24140#[doc = "ID: 4"]
24141#[derive(Debug, Clone, PartialEq)]
24142#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24143#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24144#[cfg_attr(feature = "ts", derive(TS))]
24145#[cfg_attr(feature = "ts", ts(export))]
24146pub struct PING_DATA {
24147 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
24148 pub time_usec: u64,
24149 #[doc = "PING sequence"]
24150 pub seq: u32,
24151 #[doc = "0: request ping from all receiving systems. If greater than 0: message is a ping response and number is the system id of the requesting system"]
24152 pub target_system: u8,
24153 #[doc = "0: request ping from all receiving components. If greater than 0: message is a ping response and number is the component id of the requesting component."]
24154 pub target_component: u8,
24155}
24156impl PING_DATA {
24157 pub const ENCODED_LEN: usize = 14usize;
24158 pub const DEFAULT: Self = Self {
24159 time_usec: 0_u64,
24160 seq: 0_u32,
24161 target_system: 0_u8,
24162 target_component: 0_u8,
24163 };
24164 #[cfg(feature = "arbitrary")]
24165 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24166 use arbitrary::{Arbitrary, Unstructured};
24167 let mut buf = [0u8; 1024];
24168 rng.fill_bytes(&mut buf);
24169 let mut unstructured = Unstructured::new(&buf);
24170 Self::arbitrary(&mut unstructured).unwrap_or_default()
24171 }
24172}
24173impl Default for PING_DATA {
24174 fn default() -> Self {
24175 Self::DEFAULT.clone()
24176 }
24177}
24178impl MessageData for PING_DATA {
24179 type Message = MavMessage;
24180 const ID: u32 = 4u32;
24181 const NAME: &'static str = "PING";
24182 const EXTRA_CRC: u8 = 237u8;
24183 const ENCODED_LEN: usize = 14usize;
24184 fn deser(
24185 _version: MavlinkVersion,
24186 __input: &[u8],
24187 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24188 let avail_len = __input.len();
24189 let mut payload_buf = [0; Self::ENCODED_LEN];
24190 let mut buf = if avail_len < Self::ENCODED_LEN {
24191 payload_buf[0..avail_len].copy_from_slice(__input);
24192 Bytes::new(&payload_buf)
24193 } else {
24194 Bytes::new(__input)
24195 };
24196 let mut __struct = Self::default();
24197 __struct.time_usec = buf.get_u64_le();
24198 __struct.seq = buf.get_u32_le();
24199 __struct.target_system = buf.get_u8();
24200 __struct.target_component = buf.get_u8();
24201 Ok(__struct)
24202 }
24203 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24204 let mut __tmp = BytesMut::new(bytes);
24205 #[allow(clippy::absurd_extreme_comparisons)]
24206 #[allow(unused_comparisons)]
24207 if __tmp.remaining() < Self::ENCODED_LEN {
24208 panic!(
24209 "buffer is too small (need {} bytes, but got {})",
24210 Self::ENCODED_LEN,
24211 __tmp.remaining(),
24212 )
24213 }
24214 __tmp.put_u64_le(self.time_usec);
24215 __tmp.put_u32_le(self.seq);
24216 __tmp.put_u8(self.target_system);
24217 __tmp.put_u8(self.target_component);
24218 if matches!(version, MavlinkVersion::V2) {
24219 let len = __tmp.len();
24220 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24221 } else {
24222 __tmp.len()
24223 }
24224 }
24225}
24226#[deprecated = "New version explicitly defines format. More interoperable. See `PLAY_TUNE_V2` (Deprecated since 2019-10)"]
24227#[doc = "Control vehicle tone generation (buzzer)."]
24228#[doc = ""]
24229#[doc = "ID: 258"]
24230#[derive(Debug, Clone, PartialEq)]
24231#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24232#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24233#[cfg_attr(feature = "ts", derive(TS))]
24234#[cfg_attr(feature = "ts", ts(export))]
24235pub struct PLAY_TUNE_DATA {
24236 #[doc = "System ID"]
24237 pub target_system: u8,
24238 #[doc = "Component ID"]
24239 pub target_component: u8,
24240 #[doc = "tune in board specific format"]
24241 #[cfg_attr(feature = "ts", ts(type = "string"))]
24242 pub tune: CharArray<30>,
24243 #[doc = "tune extension (appended to tune)"]
24244 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24245 #[cfg_attr(feature = "ts", ts(type = "string"))]
24246 pub tune2: CharArray<200>,
24247}
24248impl PLAY_TUNE_DATA {
24249 pub const ENCODED_LEN: usize = 232usize;
24250 pub const DEFAULT: Self = Self {
24251 target_system: 0_u8,
24252 target_component: 0_u8,
24253 tune: CharArray::new([0_u8; 30usize]),
24254 tune2: CharArray::new([0_u8; 200usize]),
24255 };
24256 #[cfg(feature = "arbitrary")]
24257 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24258 use arbitrary::{Arbitrary, Unstructured};
24259 let mut buf = [0u8; 1024];
24260 rng.fill_bytes(&mut buf);
24261 let mut unstructured = Unstructured::new(&buf);
24262 Self::arbitrary(&mut unstructured).unwrap_or_default()
24263 }
24264}
24265impl Default for PLAY_TUNE_DATA {
24266 fn default() -> Self {
24267 Self::DEFAULT.clone()
24268 }
24269}
24270impl MessageData for PLAY_TUNE_DATA {
24271 type Message = MavMessage;
24272 const ID: u32 = 258u32;
24273 const NAME: &'static str = "PLAY_TUNE";
24274 const EXTRA_CRC: u8 = 187u8;
24275 const ENCODED_LEN: usize = 232usize;
24276 fn deser(
24277 _version: MavlinkVersion,
24278 __input: &[u8],
24279 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24280 let avail_len = __input.len();
24281 let mut payload_buf = [0; Self::ENCODED_LEN];
24282 let mut buf = if avail_len < Self::ENCODED_LEN {
24283 payload_buf[0..avail_len].copy_from_slice(__input);
24284 Bytes::new(&payload_buf)
24285 } else {
24286 Bytes::new(__input)
24287 };
24288 let mut __struct = Self::default();
24289 __struct.target_system = buf.get_u8();
24290 __struct.target_component = buf.get_u8();
24291 let mut tmp = [0_u8; 30usize];
24292 for v in &mut tmp {
24293 *v = buf.get_u8();
24294 }
24295 __struct.tune = CharArray::new(tmp);
24296 let mut tmp = [0_u8; 200usize];
24297 for v in &mut tmp {
24298 *v = buf.get_u8();
24299 }
24300 __struct.tune2 = CharArray::new(tmp);
24301 Ok(__struct)
24302 }
24303 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24304 let mut __tmp = BytesMut::new(bytes);
24305 #[allow(clippy::absurd_extreme_comparisons)]
24306 #[allow(unused_comparisons)]
24307 if __tmp.remaining() < Self::ENCODED_LEN {
24308 panic!(
24309 "buffer is too small (need {} bytes, but got {})",
24310 Self::ENCODED_LEN,
24311 __tmp.remaining(),
24312 )
24313 }
24314 __tmp.put_u8(self.target_system);
24315 __tmp.put_u8(self.target_component);
24316 for val in &self.tune {
24317 __tmp.put_u8(*val);
24318 }
24319 if matches!(version, MavlinkVersion::V2) {
24320 for val in &self.tune2 {
24321 __tmp.put_u8(*val);
24322 }
24323 let len = __tmp.len();
24324 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24325 } else {
24326 __tmp.len()
24327 }
24328 }
24329}
24330#[doc = "Play vehicle tone/tune (buzzer). Supersedes message PLAY_TUNE."]
24331#[doc = ""]
24332#[doc = "ID: 400"]
24333#[derive(Debug, Clone, PartialEq)]
24334#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24335#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24336#[cfg_attr(feature = "ts", derive(TS))]
24337#[cfg_attr(feature = "ts", ts(export))]
24338pub struct PLAY_TUNE_V2_DATA {
24339 #[doc = "Tune format"]
24340 pub format: TuneFormat,
24341 #[doc = "System ID"]
24342 pub target_system: u8,
24343 #[doc = "Component ID"]
24344 pub target_component: u8,
24345 #[doc = "Tune definition as a NULL-terminated string."]
24346 #[cfg_attr(feature = "ts", ts(type = "string"))]
24347 pub tune: CharArray<248>,
24348}
24349impl PLAY_TUNE_V2_DATA {
24350 pub const ENCODED_LEN: usize = 254usize;
24351 pub const DEFAULT: Self = Self {
24352 format: TuneFormat::DEFAULT,
24353 target_system: 0_u8,
24354 target_component: 0_u8,
24355 tune: CharArray::new([0_u8; 248usize]),
24356 };
24357 #[cfg(feature = "arbitrary")]
24358 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24359 use arbitrary::{Arbitrary, Unstructured};
24360 let mut buf = [0u8; 1024];
24361 rng.fill_bytes(&mut buf);
24362 let mut unstructured = Unstructured::new(&buf);
24363 Self::arbitrary(&mut unstructured).unwrap_or_default()
24364 }
24365}
24366impl Default for PLAY_TUNE_V2_DATA {
24367 fn default() -> Self {
24368 Self::DEFAULT.clone()
24369 }
24370}
24371impl MessageData for PLAY_TUNE_V2_DATA {
24372 type Message = MavMessage;
24373 const ID: u32 = 400u32;
24374 const NAME: &'static str = "PLAY_TUNE_V2";
24375 const EXTRA_CRC: u8 = 110u8;
24376 const ENCODED_LEN: usize = 254usize;
24377 fn deser(
24378 _version: MavlinkVersion,
24379 __input: &[u8],
24380 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24381 let avail_len = __input.len();
24382 let mut payload_buf = [0; Self::ENCODED_LEN];
24383 let mut buf = if avail_len < Self::ENCODED_LEN {
24384 payload_buf[0..avail_len].copy_from_slice(__input);
24385 Bytes::new(&payload_buf)
24386 } else {
24387 Bytes::new(__input)
24388 };
24389 let mut __struct = Self::default();
24390 let tmp = buf.get_u32_le();
24391 __struct.format = FromPrimitive::from_u32(tmp).ok_or(
24392 ::mavlink_core::error::ParserError::InvalidEnum {
24393 enum_type: "TuneFormat",
24394 value: tmp as u64,
24395 },
24396 )?;
24397 __struct.target_system = buf.get_u8();
24398 __struct.target_component = buf.get_u8();
24399 let mut tmp = [0_u8; 248usize];
24400 for v in &mut tmp {
24401 *v = buf.get_u8();
24402 }
24403 __struct.tune = CharArray::new(tmp);
24404 Ok(__struct)
24405 }
24406 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24407 let mut __tmp = BytesMut::new(bytes);
24408 #[allow(clippy::absurd_extreme_comparisons)]
24409 #[allow(unused_comparisons)]
24410 if __tmp.remaining() < Self::ENCODED_LEN {
24411 panic!(
24412 "buffer is too small (need {} bytes, but got {})",
24413 Self::ENCODED_LEN,
24414 __tmp.remaining(),
24415 )
24416 }
24417 __tmp.put_u32_le(self.format as u32);
24418 __tmp.put_u8(self.target_system);
24419 __tmp.put_u8(self.target_component);
24420 for val in &self.tune {
24421 __tmp.put_u8(*val);
24422 }
24423 if matches!(version, MavlinkVersion::V2) {
24424 let len = __tmp.len();
24425 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24426 } else {
24427 __tmp.len()
24428 }
24429 }
24430}
24431#[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_GLOBAL_INT if the vehicle is being controlled this way."]
24432#[doc = ""]
24433#[doc = "ID: 87"]
24434#[derive(Debug, Clone, PartialEq)]
24435#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24436#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24437#[cfg_attr(feature = "ts", derive(TS))]
24438#[cfg_attr(feature = "ts", ts(export))]
24439pub struct POSITION_TARGET_GLOBAL_INT_DATA {
24440 #[doc = "Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency."]
24441 pub time_boot_ms: u32,
24442 #[doc = "Latitude in WGS84 frame"]
24443 pub lat_int: i32,
24444 #[doc = "Longitude in WGS84 frame"]
24445 pub lon_int: i32,
24446 #[doc = "Altitude (MSL, AGL or relative to home altitude, depending on frame)"]
24447 pub alt: f32,
24448 #[doc = "X velocity in NED frame"]
24449 pub vx: f32,
24450 #[doc = "Y velocity in NED frame"]
24451 pub vy: f32,
24452 #[doc = "Z velocity in NED frame"]
24453 pub vz: f32,
24454 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24455 pub afx: f32,
24456 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24457 pub afy: f32,
24458 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24459 pub afz: f32,
24460 #[doc = "yaw setpoint"]
24461 pub yaw: f32,
24462 #[doc = "yaw rate setpoint"]
24463 pub yaw_rate: f32,
24464 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
24465 pub type_mask: PositionTargetTypemask,
24466 #[doc = "Valid options are: MAV_FRAME_GLOBAL = 0, MAV_FRAME_GLOBAL_RELATIVE_ALT = 3, MAV_FRAME_GLOBAL_TERRAIN_ALT = 10 (MAV_FRAME_GLOBAL_INT, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT are allowed synonyms, but have been deprecated)"]
24467 pub coordinate_frame: MavFrame,
24468}
24469impl POSITION_TARGET_GLOBAL_INT_DATA {
24470 pub const ENCODED_LEN: usize = 51usize;
24471 pub const DEFAULT: Self = Self {
24472 time_boot_ms: 0_u32,
24473 lat_int: 0_i32,
24474 lon_int: 0_i32,
24475 alt: 0.0_f32,
24476 vx: 0.0_f32,
24477 vy: 0.0_f32,
24478 vz: 0.0_f32,
24479 afx: 0.0_f32,
24480 afy: 0.0_f32,
24481 afz: 0.0_f32,
24482 yaw: 0.0_f32,
24483 yaw_rate: 0.0_f32,
24484 type_mask: PositionTargetTypemask::DEFAULT,
24485 coordinate_frame: MavFrame::DEFAULT,
24486 };
24487 #[cfg(feature = "arbitrary")]
24488 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24489 use arbitrary::{Arbitrary, Unstructured};
24490 let mut buf = [0u8; 1024];
24491 rng.fill_bytes(&mut buf);
24492 let mut unstructured = Unstructured::new(&buf);
24493 Self::arbitrary(&mut unstructured).unwrap_or_default()
24494 }
24495}
24496impl Default for POSITION_TARGET_GLOBAL_INT_DATA {
24497 fn default() -> Self {
24498 Self::DEFAULT.clone()
24499 }
24500}
24501impl MessageData for POSITION_TARGET_GLOBAL_INT_DATA {
24502 type Message = MavMessage;
24503 const ID: u32 = 87u32;
24504 const NAME: &'static str = "POSITION_TARGET_GLOBAL_INT";
24505 const EXTRA_CRC: u8 = 150u8;
24506 const ENCODED_LEN: usize = 51usize;
24507 fn deser(
24508 _version: MavlinkVersion,
24509 __input: &[u8],
24510 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24511 let avail_len = __input.len();
24512 let mut payload_buf = [0; Self::ENCODED_LEN];
24513 let mut buf = if avail_len < Self::ENCODED_LEN {
24514 payload_buf[0..avail_len].copy_from_slice(__input);
24515 Bytes::new(&payload_buf)
24516 } else {
24517 Bytes::new(__input)
24518 };
24519 let mut __struct = Self::default();
24520 __struct.time_boot_ms = buf.get_u32_le();
24521 __struct.lat_int = buf.get_i32_le();
24522 __struct.lon_int = buf.get_i32_le();
24523 __struct.alt = buf.get_f32_le();
24524 __struct.vx = buf.get_f32_le();
24525 __struct.vy = buf.get_f32_le();
24526 __struct.vz = buf.get_f32_le();
24527 __struct.afx = buf.get_f32_le();
24528 __struct.afy = buf.get_f32_le();
24529 __struct.afz = buf.get_f32_le();
24530 __struct.yaw = buf.get_f32_le();
24531 __struct.yaw_rate = buf.get_f32_le();
24532 let tmp = buf.get_u16_le();
24533 __struct.type_mask = PositionTargetTypemask::from_bits(tmp).ok_or(
24534 ::mavlink_core::error::ParserError::InvalidFlag {
24535 flag_type: "PositionTargetTypemask",
24536 value: tmp as u64,
24537 },
24538 )?;
24539 let tmp = buf.get_u8();
24540 __struct.coordinate_frame =
24541 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24542 enum_type: "MavFrame",
24543 value: tmp as u64,
24544 })?;
24545 Ok(__struct)
24546 }
24547 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24548 let mut __tmp = BytesMut::new(bytes);
24549 #[allow(clippy::absurd_extreme_comparisons)]
24550 #[allow(unused_comparisons)]
24551 if __tmp.remaining() < Self::ENCODED_LEN {
24552 panic!(
24553 "buffer is too small (need {} bytes, but got {})",
24554 Self::ENCODED_LEN,
24555 __tmp.remaining(),
24556 )
24557 }
24558 __tmp.put_u32_le(self.time_boot_ms);
24559 __tmp.put_i32_le(self.lat_int);
24560 __tmp.put_i32_le(self.lon_int);
24561 __tmp.put_f32_le(self.alt);
24562 __tmp.put_f32_le(self.vx);
24563 __tmp.put_f32_le(self.vy);
24564 __tmp.put_f32_le(self.vz);
24565 __tmp.put_f32_le(self.afx);
24566 __tmp.put_f32_le(self.afy);
24567 __tmp.put_f32_le(self.afz);
24568 __tmp.put_f32_le(self.yaw);
24569 __tmp.put_f32_le(self.yaw_rate);
24570 __tmp.put_u16_le(self.type_mask.bits());
24571 __tmp.put_u8(self.coordinate_frame as u8);
24572 if matches!(version, MavlinkVersion::V2) {
24573 let len = __tmp.len();
24574 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24575 } else {
24576 __tmp.len()
24577 }
24578 }
24579}
24580#[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_LOCAL_NED if the vehicle is being controlled this way."]
24581#[doc = ""]
24582#[doc = "ID: 85"]
24583#[derive(Debug, Clone, PartialEq)]
24584#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24585#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24586#[cfg_attr(feature = "ts", derive(TS))]
24587#[cfg_attr(feature = "ts", ts(export))]
24588pub struct POSITION_TARGET_LOCAL_NED_DATA {
24589 #[doc = "Timestamp (time since system boot)."]
24590 pub time_boot_ms: u32,
24591 #[doc = "X Position in NED frame"]
24592 pub x: f32,
24593 #[doc = "Y Position in NED frame"]
24594 pub y: f32,
24595 #[doc = "Z Position in NED frame (note, altitude is negative in NED)"]
24596 pub z: f32,
24597 #[doc = "X velocity in NED frame"]
24598 pub vx: f32,
24599 #[doc = "Y velocity in NED frame"]
24600 pub vy: f32,
24601 #[doc = "Z velocity in NED frame"]
24602 pub vz: f32,
24603 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24604 pub afx: f32,
24605 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24606 pub afy: f32,
24607 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24608 pub afz: f32,
24609 #[doc = "yaw setpoint"]
24610 pub yaw: f32,
24611 #[doc = "yaw rate setpoint"]
24612 pub yaw_rate: f32,
24613 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
24614 pub type_mask: PositionTargetTypemask,
24615 #[doc = "Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9"]
24616 pub coordinate_frame: MavFrame,
24617}
24618impl POSITION_TARGET_LOCAL_NED_DATA {
24619 pub const ENCODED_LEN: usize = 51usize;
24620 pub const DEFAULT: Self = Self {
24621 time_boot_ms: 0_u32,
24622 x: 0.0_f32,
24623 y: 0.0_f32,
24624 z: 0.0_f32,
24625 vx: 0.0_f32,
24626 vy: 0.0_f32,
24627 vz: 0.0_f32,
24628 afx: 0.0_f32,
24629 afy: 0.0_f32,
24630 afz: 0.0_f32,
24631 yaw: 0.0_f32,
24632 yaw_rate: 0.0_f32,
24633 type_mask: PositionTargetTypemask::DEFAULT,
24634 coordinate_frame: MavFrame::DEFAULT,
24635 };
24636 #[cfg(feature = "arbitrary")]
24637 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24638 use arbitrary::{Arbitrary, Unstructured};
24639 let mut buf = [0u8; 1024];
24640 rng.fill_bytes(&mut buf);
24641 let mut unstructured = Unstructured::new(&buf);
24642 Self::arbitrary(&mut unstructured).unwrap_or_default()
24643 }
24644}
24645impl Default for POSITION_TARGET_LOCAL_NED_DATA {
24646 fn default() -> Self {
24647 Self::DEFAULT.clone()
24648 }
24649}
24650impl MessageData for POSITION_TARGET_LOCAL_NED_DATA {
24651 type Message = MavMessage;
24652 const ID: u32 = 85u32;
24653 const NAME: &'static str = "POSITION_TARGET_LOCAL_NED";
24654 const EXTRA_CRC: u8 = 140u8;
24655 const ENCODED_LEN: usize = 51usize;
24656 fn deser(
24657 _version: MavlinkVersion,
24658 __input: &[u8],
24659 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24660 let avail_len = __input.len();
24661 let mut payload_buf = [0; Self::ENCODED_LEN];
24662 let mut buf = if avail_len < Self::ENCODED_LEN {
24663 payload_buf[0..avail_len].copy_from_slice(__input);
24664 Bytes::new(&payload_buf)
24665 } else {
24666 Bytes::new(__input)
24667 };
24668 let mut __struct = Self::default();
24669 __struct.time_boot_ms = buf.get_u32_le();
24670 __struct.x = buf.get_f32_le();
24671 __struct.y = buf.get_f32_le();
24672 __struct.z = buf.get_f32_le();
24673 __struct.vx = buf.get_f32_le();
24674 __struct.vy = buf.get_f32_le();
24675 __struct.vz = buf.get_f32_le();
24676 __struct.afx = buf.get_f32_le();
24677 __struct.afy = buf.get_f32_le();
24678 __struct.afz = buf.get_f32_le();
24679 __struct.yaw = buf.get_f32_le();
24680 __struct.yaw_rate = buf.get_f32_le();
24681 let tmp = buf.get_u16_le();
24682 __struct.type_mask = PositionTargetTypemask::from_bits(tmp).ok_or(
24683 ::mavlink_core::error::ParserError::InvalidFlag {
24684 flag_type: "PositionTargetTypemask",
24685 value: tmp as u64,
24686 },
24687 )?;
24688 let tmp = buf.get_u8();
24689 __struct.coordinate_frame =
24690 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24691 enum_type: "MavFrame",
24692 value: tmp as u64,
24693 })?;
24694 Ok(__struct)
24695 }
24696 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24697 let mut __tmp = BytesMut::new(bytes);
24698 #[allow(clippy::absurd_extreme_comparisons)]
24699 #[allow(unused_comparisons)]
24700 if __tmp.remaining() < Self::ENCODED_LEN {
24701 panic!(
24702 "buffer is too small (need {} bytes, but got {})",
24703 Self::ENCODED_LEN,
24704 __tmp.remaining(),
24705 )
24706 }
24707 __tmp.put_u32_le(self.time_boot_ms);
24708 __tmp.put_f32_le(self.x);
24709 __tmp.put_f32_le(self.y);
24710 __tmp.put_f32_le(self.z);
24711 __tmp.put_f32_le(self.vx);
24712 __tmp.put_f32_le(self.vy);
24713 __tmp.put_f32_le(self.vz);
24714 __tmp.put_f32_le(self.afx);
24715 __tmp.put_f32_le(self.afy);
24716 __tmp.put_f32_le(self.afz);
24717 __tmp.put_f32_le(self.yaw);
24718 __tmp.put_f32_le(self.yaw_rate);
24719 __tmp.put_u16_le(self.type_mask.bits());
24720 __tmp.put_u8(self.coordinate_frame as u8);
24721 if matches!(version, MavlinkVersion::V2) {
24722 let len = __tmp.len();
24723 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24724 } else {
24725 __tmp.len()
24726 }
24727 }
24728}
24729#[doc = "Power supply status."]
24730#[doc = ""]
24731#[doc = "ID: 125"]
24732#[derive(Debug, Clone, PartialEq)]
24733#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24734#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24735#[cfg_attr(feature = "ts", derive(TS))]
24736#[cfg_attr(feature = "ts", ts(export))]
24737pub struct POWER_STATUS_DATA {
24738 #[doc = "5V rail voltage."]
24739 pub Vcc: u16,
24740 #[doc = "Servo rail voltage."]
24741 pub Vservo: u16,
24742 #[doc = "Bitmap of power supply status flags."]
24743 pub flags: MavPowerStatus,
24744}
24745impl POWER_STATUS_DATA {
24746 pub const ENCODED_LEN: usize = 6usize;
24747 pub const DEFAULT: Self = Self {
24748 Vcc: 0_u16,
24749 Vservo: 0_u16,
24750 flags: MavPowerStatus::DEFAULT,
24751 };
24752 #[cfg(feature = "arbitrary")]
24753 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24754 use arbitrary::{Arbitrary, Unstructured};
24755 let mut buf = [0u8; 1024];
24756 rng.fill_bytes(&mut buf);
24757 let mut unstructured = Unstructured::new(&buf);
24758 Self::arbitrary(&mut unstructured).unwrap_or_default()
24759 }
24760}
24761impl Default for POWER_STATUS_DATA {
24762 fn default() -> Self {
24763 Self::DEFAULT.clone()
24764 }
24765}
24766impl MessageData for POWER_STATUS_DATA {
24767 type Message = MavMessage;
24768 const ID: u32 = 125u32;
24769 const NAME: &'static str = "POWER_STATUS";
24770 const EXTRA_CRC: u8 = 203u8;
24771 const ENCODED_LEN: usize = 6usize;
24772 fn deser(
24773 _version: MavlinkVersion,
24774 __input: &[u8],
24775 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24776 let avail_len = __input.len();
24777 let mut payload_buf = [0; Self::ENCODED_LEN];
24778 let mut buf = if avail_len < Self::ENCODED_LEN {
24779 payload_buf[0..avail_len].copy_from_slice(__input);
24780 Bytes::new(&payload_buf)
24781 } else {
24782 Bytes::new(__input)
24783 };
24784 let mut __struct = Self::default();
24785 __struct.Vcc = buf.get_u16_le();
24786 __struct.Vservo = buf.get_u16_le();
24787 let tmp = buf.get_u16_le();
24788 __struct.flags = MavPowerStatus::from_bits(tmp).ok_or(
24789 ::mavlink_core::error::ParserError::InvalidFlag {
24790 flag_type: "MavPowerStatus",
24791 value: tmp as u64,
24792 },
24793 )?;
24794 Ok(__struct)
24795 }
24796 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24797 let mut __tmp = BytesMut::new(bytes);
24798 #[allow(clippy::absurd_extreme_comparisons)]
24799 #[allow(unused_comparisons)]
24800 if __tmp.remaining() < Self::ENCODED_LEN {
24801 panic!(
24802 "buffer is too small (need {} bytes, but got {})",
24803 Self::ENCODED_LEN,
24804 __tmp.remaining(),
24805 )
24806 }
24807 __tmp.put_u16_le(self.Vcc);
24808 __tmp.put_u16_le(self.Vservo);
24809 __tmp.put_u16_le(self.flags.bits());
24810 if matches!(version, MavlinkVersion::V2) {
24811 let len = __tmp.len();
24812 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24813 } else {
24814 __tmp.len()
24815 }
24816 }
24817}
24818#[doc = "Version and capability of protocol version. This message can be requested with MAV_CMD_REQUEST_MESSAGE and is used as part of the handshaking to establish which MAVLink version should be used on the network. Every node should respond to a request for PROTOCOL_VERSION to enable the handshaking. Library implementers should consider adding this into the default decoding state machine to allow the protocol core to respond directly."]
24819#[doc = ""]
24820#[doc = "ID: 300"]
24821#[derive(Debug, Clone, PartialEq)]
24822#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24823#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24824#[cfg_attr(feature = "ts", derive(TS))]
24825#[cfg_attr(feature = "ts", ts(export))]
24826pub struct PROTOCOL_VERSION_DATA {
24827 #[doc = "Currently active MAVLink version number * 100: v1.0 is 100, v2.0 is 200, etc."]
24828 pub version: u16,
24829 #[doc = "Minimum MAVLink version supported"]
24830 pub min_version: u16,
24831 #[doc = "Maximum MAVLink version supported (set to the same value as version by default)"]
24832 pub max_version: u16,
24833 #[doc = "The first 8 bytes (not characters printed in hex!) of the git hash."]
24834 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24835 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
24836 pub spec_version_hash: [u8; 8],
24837 #[doc = "The first 8 bytes (not characters printed in hex!) of the git hash."]
24838 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24839 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
24840 pub library_version_hash: [u8; 8],
24841}
24842impl PROTOCOL_VERSION_DATA {
24843 pub const ENCODED_LEN: usize = 22usize;
24844 pub const DEFAULT: Self = Self {
24845 version: 0_u16,
24846 min_version: 0_u16,
24847 max_version: 0_u16,
24848 spec_version_hash: [0_u8; 8usize],
24849 library_version_hash: [0_u8; 8usize],
24850 };
24851 #[cfg(feature = "arbitrary")]
24852 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24853 use arbitrary::{Arbitrary, Unstructured};
24854 let mut buf = [0u8; 1024];
24855 rng.fill_bytes(&mut buf);
24856 let mut unstructured = Unstructured::new(&buf);
24857 Self::arbitrary(&mut unstructured).unwrap_or_default()
24858 }
24859}
24860impl Default for PROTOCOL_VERSION_DATA {
24861 fn default() -> Self {
24862 Self::DEFAULT.clone()
24863 }
24864}
24865impl MessageData for PROTOCOL_VERSION_DATA {
24866 type Message = MavMessage;
24867 const ID: u32 = 300u32;
24868 const NAME: &'static str = "PROTOCOL_VERSION";
24869 const EXTRA_CRC: u8 = 217u8;
24870 const ENCODED_LEN: usize = 22usize;
24871 fn deser(
24872 _version: MavlinkVersion,
24873 __input: &[u8],
24874 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24875 let avail_len = __input.len();
24876 let mut payload_buf = [0; Self::ENCODED_LEN];
24877 let mut buf = if avail_len < Self::ENCODED_LEN {
24878 payload_buf[0..avail_len].copy_from_slice(__input);
24879 Bytes::new(&payload_buf)
24880 } else {
24881 Bytes::new(__input)
24882 };
24883 let mut __struct = Self::default();
24884 __struct.version = buf.get_u16_le();
24885 __struct.min_version = buf.get_u16_le();
24886 __struct.max_version = buf.get_u16_le();
24887 for v in &mut __struct.spec_version_hash {
24888 let val = buf.get_u8();
24889 *v = val;
24890 }
24891 for v in &mut __struct.library_version_hash {
24892 let val = buf.get_u8();
24893 *v = val;
24894 }
24895 Ok(__struct)
24896 }
24897 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24898 let mut __tmp = BytesMut::new(bytes);
24899 #[allow(clippy::absurd_extreme_comparisons)]
24900 #[allow(unused_comparisons)]
24901 if __tmp.remaining() < Self::ENCODED_LEN {
24902 panic!(
24903 "buffer is too small (need {} bytes, but got {})",
24904 Self::ENCODED_LEN,
24905 __tmp.remaining(),
24906 )
24907 }
24908 __tmp.put_u16_le(self.version);
24909 __tmp.put_u16_le(self.min_version);
24910 __tmp.put_u16_le(self.max_version);
24911 for val in &self.spec_version_hash {
24912 __tmp.put_u8(*val);
24913 }
24914 for val in &self.library_version_hash {
24915 __tmp.put_u8(*val);
24916 }
24917 if matches!(version, MavlinkVersion::V2) {
24918 let len = __tmp.len();
24919 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24920 } else {
24921 __tmp.len()
24922 }
24923 }
24924}
24925#[doc = "Complete set of calibration parameters for the radio."]
24926#[doc = ""]
24927#[doc = "ID: 221"]
24928#[derive(Debug, Clone, PartialEq)]
24929#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24930#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24931#[cfg_attr(feature = "ts", derive(TS))]
24932#[cfg_attr(feature = "ts", ts(export))]
24933pub struct RADIO_CALIBRATION_DATA {
24934 #[doc = "Aileron setpoints: left, center, right"]
24935 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24936 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
24937 pub aileron: [u16; 3],
24938 #[doc = "Elevator setpoints: nose down, center, nose up"]
24939 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24940 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
24941 pub elevator: [u16; 3],
24942 #[doc = "Rudder setpoints: nose left, center, nose right"]
24943 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24944 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
24945 pub rudder: [u16; 3],
24946 #[doc = "Tail gyro mode/gain setpoints: heading hold, rate mode"]
24947 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24948 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
24949 pub gyro: [u16; 2],
24950 #[doc = "Pitch curve setpoints (every 25%)"]
24951 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24952 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
24953 pub pitch: [u16; 5],
24954 #[doc = "Throttle curve setpoints (every 25%)"]
24955 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24956 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
24957 pub throttle: [u16; 5],
24958}
24959impl RADIO_CALIBRATION_DATA {
24960 pub const ENCODED_LEN: usize = 42usize;
24961 pub const DEFAULT: Self = Self {
24962 aileron: [0_u16; 3usize],
24963 elevator: [0_u16; 3usize],
24964 rudder: [0_u16; 3usize],
24965 gyro: [0_u16; 2usize],
24966 pitch: [0_u16; 5usize],
24967 throttle: [0_u16; 5usize],
24968 };
24969 #[cfg(feature = "arbitrary")]
24970 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24971 use arbitrary::{Arbitrary, Unstructured};
24972 let mut buf = [0u8; 1024];
24973 rng.fill_bytes(&mut buf);
24974 let mut unstructured = Unstructured::new(&buf);
24975 Self::arbitrary(&mut unstructured).unwrap_or_default()
24976 }
24977}
24978impl Default for RADIO_CALIBRATION_DATA {
24979 fn default() -> Self {
24980 Self::DEFAULT.clone()
24981 }
24982}
24983impl MessageData for RADIO_CALIBRATION_DATA {
24984 type Message = MavMessage;
24985 const ID: u32 = 221u32;
24986 const NAME: &'static str = "RADIO_CALIBRATION";
24987 const EXTRA_CRC: u8 = 71u8;
24988 const ENCODED_LEN: usize = 42usize;
24989 fn deser(
24990 _version: MavlinkVersion,
24991 __input: &[u8],
24992 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24993 let avail_len = __input.len();
24994 let mut payload_buf = [0; Self::ENCODED_LEN];
24995 let mut buf = if avail_len < Self::ENCODED_LEN {
24996 payload_buf[0..avail_len].copy_from_slice(__input);
24997 Bytes::new(&payload_buf)
24998 } else {
24999 Bytes::new(__input)
25000 };
25001 let mut __struct = Self::default();
25002 for v in &mut __struct.aileron {
25003 let val = buf.get_u16_le();
25004 *v = val;
25005 }
25006 for v in &mut __struct.elevator {
25007 let val = buf.get_u16_le();
25008 *v = val;
25009 }
25010 for v in &mut __struct.rudder {
25011 let val = buf.get_u16_le();
25012 *v = val;
25013 }
25014 for v in &mut __struct.gyro {
25015 let val = buf.get_u16_le();
25016 *v = val;
25017 }
25018 for v in &mut __struct.pitch {
25019 let val = buf.get_u16_le();
25020 *v = val;
25021 }
25022 for v in &mut __struct.throttle {
25023 let val = buf.get_u16_le();
25024 *v = val;
25025 }
25026 Ok(__struct)
25027 }
25028 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25029 let mut __tmp = BytesMut::new(bytes);
25030 #[allow(clippy::absurd_extreme_comparisons)]
25031 #[allow(unused_comparisons)]
25032 if __tmp.remaining() < Self::ENCODED_LEN {
25033 panic!(
25034 "buffer is too small (need {} bytes, but got {})",
25035 Self::ENCODED_LEN,
25036 __tmp.remaining(),
25037 )
25038 }
25039 for val in &self.aileron {
25040 __tmp.put_u16_le(*val);
25041 }
25042 for val in &self.elevator {
25043 __tmp.put_u16_le(*val);
25044 }
25045 for val in &self.rudder {
25046 __tmp.put_u16_le(*val);
25047 }
25048 for val in &self.gyro {
25049 __tmp.put_u16_le(*val);
25050 }
25051 for val in &self.pitch {
25052 __tmp.put_u16_le(*val);
25053 }
25054 for val in &self.throttle {
25055 __tmp.put_u16_le(*val);
25056 }
25057 if matches!(version, MavlinkVersion::V2) {
25058 let len = __tmp.len();
25059 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25060 } else {
25061 __tmp.len()
25062 }
25063 }
25064}
25065#[doc = "Status generated by radio and injected into MAVLink stream."]
25066#[doc = ""]
25067#[doc = "ID: 109"]
25068#[derive(Debug, Clone, PartialEq)]
25069#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25070#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25071#[cfg_attr(feature = "ts", derive(TS))]
25072#[cfg_attr(feature = "ts", ts(export))]
25073pub struct RADIO_STATUS_DATA {
25074 #[doc = "Count of radio packet receive errors (since boot)."]
25075 pub rxerrors: u16,
25076 #[doc = "Count of error corrected radio packets (since boot)."]
25077 pub fixed: u16,
25078 #[doc = "Local (message sender) received signal strength indication in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
25079 pub rssi: u8,
25080 #[doc = "Remote (message receiver) signal strength indication in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
25081 pub remrssi: u8,
25082 #[doc = "Remaining free transmitter buffer space."]
25083 pub txbuf: u8,
25084 #[doc = "Local background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], UINT8_MAX: invalid/unknown."]
25085 pub noise: u8,
25086 #[doc = "Remote background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], UINT8_MAX: invalid/unknown."]
25087 pub remnoise: u8,
25088}
25089impl RADIO_STATUS_DATA {
25090 pub const ENCODED_LEN: usize = 9usize;
25091 pub const DEFAULT: Self = Self {
25092 rxerrors: 0_u16,
25093 fixed: 0_u16,
25094 rssi: 0_u8,
25095 remrssi: 0_u8,
25096 txbuf: 0_u8,
25097 noise: 0_u8,
25098 remnoise: 0_u8,
25099 };
25100 #[cfg(feature = "arbitrary")]
25101 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25102 use arbitrary::{Arbitrary, Unstructured};
25103 let mut buf = [0u8; 1024];
25104 rng.fill_bytes(&mut buf);
25105 let mut unstructured = Unstructured::new(&buf);
25106 Self::arbitrary(&mut unstructured).unwrap_or_default()
25107 }
25108}
25109impl Default for RADIO_STATUS_DATA {
25110 fn default() -> Self {
25111 Self::DEFAULT.clone()
25112 }
25113}
25114impl MessageData for RADIO_STATUS_DATA {
25115 type Message = MavMessage;
25116 const ID: u32 = 109u32;
25117 const NAME: &'static str = "RADIO_STATUS";
25118 const EXTRA_CRC: u8 = 185u8;
25119 const ENCODED_LEN: usize = 9usize;
25120 fn deser(
25121 _version: MavlinkVersion,
25122 __input: &[u8],
25123 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25124 let avail_len = __input.len();
25125 let mut payload_buf = [0; Self::ENCODED_LEN];
25126 let mut buf = if avail_len < Self::ENCODED_LEN {
25127 payload_buf[0..avail_len].copy_from_slice(__input);
25128 Bytes::new(&payload_buf)
25129 } else {
25130 Bytes::new(__input)
25131 };
25132 let mut __struct = Self::default();
25133 __struct.rxerrors = buf.get_u16_le();
25134 __struct.fixed = buf.get_u16_le();
25135 __struct.rssi = buf.get_u8();
25136 __struct.remrssi = buf.get_u8();
25137 __struct.txbuf = buf.get_u8();
25138 __struct.noise = buf.get_u8();
25139 __struct.remnoise = buf.get_u8();
25140 Ok(__struct)
25141 }
25142 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25143 let mut __tmp = BytesMut::new(bytes);
25144 #[allow(clippy::absurd_extreme_comparisons)]
25145 #[allow(unused_comparisons)]
25146 if __tmp.remaining() < Self::ENCODED_LEN {
25147 panic!(
25148 "buffer is too small (need {} bytes, but got {})",
25149 Self::ENCODED_LEN,
25150 __tmp.remaining(),
25151 )
25152 }
25153 __tmp.put_u16_le(self.rxerrors);
25154 __tmp.put_u16_le(self.fixed);
25155 __tmp.put_u8(self.rssi);
25156 __tmp.put_u8(self.remrssi);
25157 __tmp.put_u8(self.txbuf);
25158 __tmp.put_u8(self.noise);
25159 __tmp.put_u8(self.remnoise);
25160 if matches!(version, MavlinkVersion::V2) {
25161 let len = __tmp.len();
25162 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25163 } else {
25164 __tmp.len()
25165 }
25166 }
25167}
25168#[doc = "The RAW IMU readings for a 9DOF sensor, which is identified by the id (default IMU1). This message should always contain the true raw values without any scaling to allow data capture and system debugging."]
25169#[doc = ""]
25170#[doc = "ID: 27"]
25171#[derive(Debug, Clone, PartialEq)]
25172#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25173#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25174#[cfg_attr(feature = "ts", derive(TS))]
25175#[cfg_attr(feature = "ts", ts(export))]
25176pub struct RAW_IMU_DATA {
25177 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
25178 pub time_usec: u64,
25179 #[doc = "X acceleration (raw)"]
25180 pub xacc: i16,
25181 #[doc = "Y acceleration (raw)"]
25182 pub yacc: i16,
25183 #[doc = "Z acceleration (raw)"]
25184 pub zacc: i16,
25185 #[doc = "Angular speed around X axis (raw)"]
25186 pub xgyro: i16,
25187 #[doc = "Angular speed around Y axis (raw)"]
25188 pub ygyro: i16,
25189 #[doc = "Angular speed around Z axis (raw)"]
25190 pub zgyro: i16,
25191 #[doc = "X Magnetic field (raw)"]
25192 pub xmag: i16,
25193 #[doc = "Y Magnetic field (raw)"]
25194 pub ymag: i16,
25195 #[doc = "Z Magnetic field (raw)"]
25196 pub zmag: i16,
25197 #[doc = "Id. Ids are numbered from 0 and map to IMUs numbered from 1 (e.g. IMU1 will have a message with id=0)"]
25198 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25199 pub id: u8,
25200 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
25201 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25202 pub temperature: i16,
25203}
25204impl RAW_IMU_DATA {
25205 pub const ENCODED_LEN: usize = 29usize;
25206 pub const DEFAULT: Self = Self {
25207 time_usec: 0_u64,
25208 xacc: 0_i16,
25209 yacc: 0_i16,
25210 zacc: 0_i16,
25211 xgyro: 0_i16,
25212 ygyro: 0_i16,
25213 zgyro: 0_i16,
25214 xmag: 0_i16,
25215 ymag: 0_i16,
25216 zmag: 0_i16,
25217 id: 0_u8,
25218 temperature: 0_i16,
25219 };
25220 #[cfg(feature = "arbitrary")]
25221 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25222 use arbitrary::{Arbitrary, Unstructured};
25223 let mut buf = [0u8; 1024];
25224 rng.fill_bytes(&mut buf);
25225 let mut unstructured = Unstructured::new(&buf);
25226 Self::arbitrary(&mut unstructured).unwrap_or_default()
25227 }
25228}
25229impl Default for RAW_IMU_DATA {
25230 fn default() -> Self {
25231 Self::DEFAULT.clone()
25232 }
25233}
25234impl MessageData for RAW_IMU_DATA {
25235 type Message = MavMessage;
25236 const ID: u32 = 27u32;
25237 const NAME: &'static str = "RAW_IMU";
25238 const EXTRA_CRC: u8 = 144u8;
25239 const ENCODED_LEN: usize = 29usize;
25240 fn deser(
25241 _version: MavlinkVersion,
25242 __input: &[u8],
25243 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25244 let avail_len = __input.len();
25245 let mut payload_buf = [0; Self::ENCODED_LEN];
25246 let mut buf = if avail_len < Self::ENCODED_LEN {
25247 payload_buf[0..avail_len].copy_from_slice(__input);
25248 Bytes::new(&payload_buf)
25249 } else {
25250 Bytes::new(__input)
25251 };
25252 let mut __struct = Self::default();
25253 __struct.time_usec = buf.get_u64_le();
25254 __struct.xacc = buf.get_i16_le();
25255 __struct.yacc = buf.get_i16_le();
25256 __struct.zacc = buf.get_i16_le();
25257 __struct.xgyro = buf.get_i16_le();
25258 __struct.ygyro = buf.get_i16_le();
25259 __struct.zgyro = buf.get_i16_le();
25260 __struct.xmag = buf.get_i16_le();
25261 __struct.ymag = buf.get_i16_le();
25262 __struct.zmag = buf.get_i16_le();
25263 __struct.id = buf.get_u8();
25264 __struct.temperature = buf.get_i16_le();
25265 Ok(__struct)
25266 }
25267 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25268 let mut __tmp = BytesMut::new(bytes);
25269 #[allow(clippy::absurd_extreme_comparisons)]
25270 #[allow(unused_comparisons)]
25271 if __tmp.remaining() < Self::ENCODED_LEN {
25272 panic!(
25273 "buffer is too small (need {} bytes, but got {})",
25274 Self::ENCODED_LEN,
25275 __tmp.remaining(),
25276 )
25277 }
25278 __tmp.put_u64_le(self.time_usec);
25279 __tmp.put_i16_le(self.xacc);
25280 __tmp.put_i16_le(self.yacc);
25281 __tmp.put_i16_le(self.zacc);
25282 __tmp.put_i16_le(self.xgyro);
25283 __tmp.put_i16_le(self.ygyro);
25284 __tmp.put_i16_le(self.zgyro);
25285 __tmp.put_i16_le(self.xmag);
25286 __tmp.put_i16_le(self.ymag);
25287 __tmp.put_i16_le(self.zmag);
25288 if matches!(version, MavlinkVersion::V2) {
25289 __tmp.put_u8(self.id);
25290 __tmp.put_i16_le(self.temperature);
25291 let len = __tmp.len();
25292 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25293 } else {
25294 __tmp.len()
25295 }
25296 }
25297}
25298#[doc = "The RAW pressure readings for the typical setup of one absolute pressure and one differential pressure sensor. The sensor values should be the raw, UNSCALED ADC values."]
25299#[doc = ""]
25300#[doc = "ID: 28"]
25301#[derive(Debug, Clone, PartialEq)]
25302#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25303#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25304#[cfg_attr(feature = "ts", derive(TS))]
25305#[cfg_attr(feature = "ts", ts(export))]
25306pub struct RAW_PRESSURE_DATA {
25307 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
25308 pub time_usec: u64,
25309 #[doc = "Absolute pressure (raw)"]
25310 pub press_abs: i16,
25311 #[doc = "Differential pressure 1 (raw, 0 if nonexistent)"]
25312 pub press_diff1: i16,
25313 #[doc = "Differential pressure 2 (raw, 0 if nonexistent)"]
25314 pub press_diff2: i16,
25315 #[doc = "Raw Temperature measurement (raw)"]
25316 pub temperature: i16,
25317}
25318impl RAW_PRESSURE_DATA {
25319 pub const ENCODED_LEN: usize = 16usize;
25320 pub const DEFAULT: Self = Self {
25321 time_usec: 0_u64,
25322 press_abs: 0_i16,
25323 press_diff1: 0_i16,
25324 press_diff2: 0_i16,
25325 temperature: 0_i16,
25326 };
25327 #[cfg(feature = "arbitrary")]
25328 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25329 use arbitrary::{Arbitrary, Unstructured};
25330 let mut buf = [0u8; 1024];
25331 rng.fill_bytes(&mut buf);
25332 let mut unstructured = Unstructured::new(&buf);
25333 Self::arbitrary(&mut unstructured).unwrap_or_default()
25334 }
25335}
25336impl Default for RAW_PRESSURE_DATA {
25337 fn default() -> Self {
25338 Self::DEFAULT.clone()
25339 }
25340}
25341impl MessageData for RAW_PRESSURE_DATA {
25342 type Message = MavMessage;
25343 const ID: u32 = 28u32;
25344 const NAME: &'static str = "RAW_PRESSURE";
25345 const EXTRA_CRC: u8 = 67u8;
25346 const ENCODED_LEN: usize = 16usize;
25347 fn deser(
25348 _version: MavlinkVersion,
25349 __input: &[u8],
25350 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25351 let avail_len = __input.len();
25352 let mut payload_buf = [0; Self::ENCODED_LEN];
25353 let mut buf = if avail_len < Self::ENCODED_LEN {
25354 payload_buf[0..avail_len].copy_from_slice(__input);
25355 Bytes::new(&payload_buf)
25356 } else {
25357 Bytes::new(__input)
25358 };
25359 let mut __struct = Self::default();
25360 __struct.time_usec = buf.get_u64_le();
25361 __struct.press_abs = buf.get_i16_le();
25362 __struct.press_diff1 = buf.get_i16_le();
25363 __struct.press_diff2 = buf.get_i16_le();
25364 __struct.temperature = buf.get_i16_le();
25365 Ok(__struct)
25366 }
25367 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25368 let mut __tmp = BytesMut::new(bytes);
25369 #[allow(clippy::absurd_extreme_comparisons)]
25370 #[allow(unused_comparisons)]
25371 if __tmp.remaining() < Self::ENCODED_LEN {
25372 panic!(
25373 "buffer is too small (need {} bytes, but got {})",
25374 Self::ENCODED_LEN,
25375 __tmp.remaining(),
25376 )
25377 }
25378 __tmp.put_u64_le(self.time_usec);
25379 __tmp.put_i16_le(self.press_abs);
25380 __tmp.put_i16_le(self.press_diff1);
25381 __tmp.put_i16_le(self.press_diff2);
25382 __tmp.put_i16_le(self.temperature);
25383 if matches!(version, MavlinkVersion::V2) {
25384 let len = __tmp.len();
25385 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25386 } else {
25387 __tmp.len()
25388 }
25389 }
25390}
25391#[doc = "RPM sensor data message."]
25392#[doc = ""]
25393#[doc = "ID: 339"]
25394#[derive(Debug, Clone, PartialEq)]
25395#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25396#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25397#[cfg_attr(feature = "ts", derive(TS))]
25398#[cfg_attr(feature = "ts", ts(export))]
25399pub struct RAW_RPM_DATA {
25400 #[doc = "Indicated rate"]
25401 pub frequency: f32,
25402 #[doc = "Index of this RPM sensor (0-indexed)"]
25403 pub index: u8,
25404}
25405impl RAW_RPM_DATA {
25406 pub const ENCODED_LEN: usize = 5usize;
25407 pub const DEFAULT: Self = Self {
25408 frequency: 0.0_f32,
25409 index: 0_u8,
25410 };
25411 #[cfg(feature = "arbitrary")]
25412 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25413 use arbitrary::{Arbitrary, Unstructured};
25414 let mut buf = [0u8; 1024];
25415 rng.fill_bytes(&mut buf);
25416 let mut unstructured = Unstructured::new(&buf);
25417 Self::arbitrary(&mut unstructured).unwrap_or_default()
25418 }
25419}
25420impl Default for RAW_RPM_DATA {
25421 fn default() -> Self {
25422 Self::DEFAULT.clone()
25423 }
25424}
25425impl MessageData for RAW_RPM_DATA {
25426 type Message = MavMessage;
25427 const ID: u32 = 339u32;
25428 const NAME: &'static str = "RAW_RPM";
25429 const EXTRA_CRC: u8 = 199u8;
25430 const ENCODED_LEN: usize = 5usize;
25431 fn deser(
25432 _version: MavlinkVersion,
25433 __input: &[u8],
25434 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25435 let avail_len = __input.len();
25436 let mut payload_buf = [0; Self::ENCODED_LEN];
25437 let mut buf = if avail_len < Self::ENCODED_LEN {
25438 payload_buf[0..avail_len].copy_from_slice(__input);
25439 Bytes::new(&payload_buf)
25440 } else {
25441 Bytes::new(__input)
25442 };
25443 let mut __struct = Self::default();
25444 __struct.frequency = buf.get_f32_le();
25445 __struct.index = buf.get_u8();
25446 Ok(__struct)
25447 }
25448 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25449 let mut __tmp = BytesMut::new(bytes);
25450 #[allow(clippy::absurd_extreme_comparisons)]
25451 #[allow(unused_comparisons)]
25452 if __tmp.remaining() < Self::ENCODED_LEN {
25453 panic!(
25454 "buffer is too small (need {} bytes, but got {})",
25455 Self::ENCODED_LEN,
25456 __tmp.remaining(),
25457 )
25458 }
25459 __tmp.put_f32_le(self.frequency);
25460 __tmp.put_u8(self.index);
25461 if matches!(version, MavlinkVersion::V2) {
25462 let len = __tmp.len();
25463 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25464 } else {
25465 __tmp.len()
25466 }
25467 }
25468}
25469#[doc = "The PPM values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
25470#[doc = ""]
25471#[doc = "ID: 65"]
25472#[derive(Debug, Clone, PartialEq)]
25473#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25474#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25475#[cfg_attr(feature = "ts", derive(TS))]
25476#[cfg_attr(feature = "ts", ts(export))]
25477pub struct RC_CHANNELS_DATA {
25478 #[doc = "Timestamp (time since system boot)."]
25479 pub time_boot_ms: u32,
25480 #[doc = "RC channel 1 value."]
25481 pub chan1_raw: u16,
25482 #[doc = "RC channel 2 value."]
25483 pub chan2_raw: u16,
25484 #[doc = "RC channel 3 value."]
25485 pub chan3_raw: u16,
25486 #[doc = "RC channel 4 value."]
25487 pub chan4_raw: u16,
25488 #[doc = "RC channel 5 value."]
25489 pub chan5_raw: u16,
25490 #[doc = "RC channel 6 value."]
25491 pub chan6_raw: u16,
25492 #[doc = "RC channel 7 value."]
25493 pub chan7_raw: u16,
25494 #[doc = "RC channel 8 value."]
25495 pub chan8_raw: u16,
25496 #[doc = "RC channel 9 value."]
25497 pub chan9_raw: u16,
25498 #[doc = "RC channel 10 value."]
25499 pub chan10_raw: u16,
25500 #[doc = "RC channel 11 value."]
25501 pub chan11_raw: u16,
25502 #[doc = "RC channel 12 value."]
25503 pub chan12_raw: u16,
25504 #[doc = "RC channel 13 value."]
25505 pub chan13_raw: u16,
25506 #[doc = "RC channel 14 value."]
25507 pub chan14_raw: u16,
25508 #[doc = "RC channel 15 value."]
25509 pub chan15_raw: u16,
25510 #[doc = "RC channel 16 value."]
25511 pub chan16_raw: u16,
25512 #[doc = "RC channel 17 value."]
25513 pub chan17_raw: u16,
25514 #[doc = "RC channel 18 value."]
25515 pub chan18_raw: u16,
25516 #[doc = "Total number of RC channels being received. This can be larger than 18, indicating that more channels are available but not given in this message. This value should be 0 when no RC channels are available."]
25517 pub chancount: u8,
25518 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
25519 pub rssi: u8,
25520}
25521impl RC_CHANNELS_DATA {
25522 pub const ENCODED_LEN: usize = 42usize;
25523 pub const DEFAULT: Self = Self {
25524 time_boot_ms: 0_u32,
25525 chan1_raw: 0_u16,
25526 chan2_raw: 0_u16,
25527 chan3_raw: 0_u16,
25528 chan4_raw: 0_u16,
25529 chan5_raw: 0_u16,
25530 chan6_raw: 0_u16,
25531 chan7_raw: 0_u16,
25532 chan8_raw: 0_u16,
25533 chan9_raw: 0_u16,
25534 chan10_raw: 0_u16,
25535 chan11_raw: 0_u16,
25536 chan12_raw: 0_u16,
25537 chan13_raw: 0_u16,
25538 chan14_raw: 0_u16,
25539 chan15_raw: 0_u16,
25540 chan16_raw: 0_u16,
25541 chan17_raw: 0_u16,
25542 chan18_raw: 0_u16,
25543 chancount: 0_u8,
25544 rssi: 0_u8,
25545 };
25546 #[cfg(feature = "arbitrary")]
25547 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25548 use arbitrary::{Arbitrary, Unstructured};
25549 let mut buf = [0u8; 1024];
25550 rng.fill_bytes(&mut buf);
25551 let mut unstructured = Unstructured::new(&buf);
25552 Self::arbitrary(&mut unstructured).unwrap_or_default()
25553 }
25554}
25555impl Default for RC_CHANNELS_DATA {
25556 fn default() -> Self {
25557 Self::DEFAULT.clone()
25558 }
25559}
25560impl MessageData for RC_CHANNELS_DATA {
25561 type Message = MavMessage;
25562 const ID: u32 = 65u32;
25563 const NAME: &'static str = "RC_CHANNELS";
25564 const EXTRA_CRC: u8 = 118u8;
25565 const ENCODED_LEN: usize = 42usize;
25566 fn deser(
25567 _version: MavlinkVersion,
25568 __input: &[u8],
25569 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25570 let avail_len = __input.len();
25571 let mut payload_buf = [0; Self::ENCODED_LEN];
25572 let mut buf = if avail_len < Self::ENCODED_LEN {
25573 payload_buf[0..avail_len].copy_from_slice(__input);
25574 Bytes::new(&payload_buf)
25575 } else {
25576 Bytes::new(__input)
25577 };
25578 let mut __struct = Self::default();
25579 __struct.time_boot_ms = buf.get_u32_le();
25580 __struct.chan1_raw = buf.get_u16_le();
25581 __struct.chan2_raw = buf.get_u16_le();
25582 __struct.chan3_raw = buf.get_u16_le();
25583 __struct.chan4_raw = buf.get_u16_le();
25584 __struct.chan5_raw = buf.get_u16_le();
25585 __struct.chan6_raw = buf.get_u16_le();
25586 __struct.chan7_raw = buf.get_u16_le();
25587 __struct.chan8_raw = buf.get_u16_le();
25588 __struct.chan9_raw = buf.get_u16_le();
25589 __struct.chan10_raw = buf.get_u16_le();
25590 __struct.chan11_raw = buf.get_u16_le();
25591 __struct.chan12_raw = buf.get_u16_le();
25592 __struct.chan13_raw = buf.get_u16_le();
25593 __struct.chan14_raw = buf.get_u16_le();
25594 __struct.chan15_raw = buf.get_u16_le();
25595 __struct.chan16_raw = buf.get_u16_le();
25596 __struct.chan17_raw = buf.get_u16_le();
25597 __struct.chan18_raw = buf.get_u16_le();
25598 __struct.chancount = buf.get_u8();
25599 __struct.rssi = buf.get_u8();
25600 Ok(__struct)
25601 }
25602 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25603 let mut __tmp = BytesMut::new(bytes);
25604 #[allow(clippy::absurd_extreme_comparisons)]
25605 #[allow(unused_comparisons)]
25606 if __tmp.remaining() < Self::ENCODED_LEN {
25607 panic!(
25608 "buffer is too small (need {} bytes, but got {})",
25609 Self::ENCODED_LEN,
25610 __tmp.remaining(),
25611 )
25612 }
25613 __tmp.put_u32_le(self.time_boot_ms);
25614 __tmp.put_u16_le(self.chan1_raw);
25615 __tmp.put_u16_le(self.chan2_raw);
25616 __tmp.put_u16_le(self.chan3_raw);
25617 __tmp.put_u16_le(self.chan4_raw);
25618 __tmp.put_u16_le(self.chan5_raw);
25619 __tmp.put_u16_le(self.chan6_raw);
25620 __tmp.put_u16_le(self.chan7_raw);
25621 __tmp.put_u16_le(self.chan8_raw);
25622 __tmp.put_u16_le(self.chan9_raw);
25623 __tmp.put_u16_le(self.chan10_raw);
25624 __tmp.put_u16_le(self.chan11_raw);
25625 __tmp.put_u16_le(self.chan12_raw);
25626 __tmp.put_u16_le(self.chan13_raw);
25627 __tmp.put_u16_le(self.chan14_raw);
25628 __tmp.put_u16_le(self.chan15_raw);
25629 __tmp.put_u16_le(self.chan16_raw);
25630 __tmp.put_u16_le(self.chan17_raw);
25631 __tmp.put_u16_le(self.chan18_raw);
25632 __tmp.put_u8(self.chancount);
25633 __tmp.put_u8(self.rssi);
25634 if matches!(version, MavlinkVersion::V2) {
25635 let len = __tmp.len();
25636 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25637 } else {
25638 __tmp.len()
25639 }
25640 }
25641}
25642#[doc = "The RAW values of the RC channels sent to the MAV to override info received from the RC radio. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. Note carefully the semantic differences between the first 8 channels and the subsequent channels."]
25643#[doc = ""]
25644#[doc = "ID: 70"]
25645#[derive(Debug, Clone, PartialEq)]
25646#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25647#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25648#[cfg_attr(feature = "ts", derive(TS))]
25649#[cfg_attr(feature = "ts", ts(export))]
25650pub struct RC_CHANNELS_OVERRIDE_DATA {
25651 #[doc = "RC channel 1 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25652 pub chan1_raw: u16,
25653 #[doc = "RC channel 2 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25654 pub chan2_raw: u16,
25655 #[doc = "RC channel 3 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25656 pub chan3_raw: u16,
25657 #[doc = "RC channel 4 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25658 pub chan4_raw: u16,
25659 #[doc = "RC channel 5 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25660 pub chan5_raw: u16,
25661 #[doc = "RC channel 6 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25662 pub chan6_raw: u16,
25663 #[doc = "RC channel 7 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25664 pub chan7_raw: u16,
25665 #[doc = "RC channel 8 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25666 pub chan8_raw: u16,
25667 #[doc = "System ID"]
25668 pub target_system: u8,
25669 #[doc = "Component ID"]
25670 pub target_component: u8,
25671 #[doc = "RC channel 9 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25672 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25673 pub chan9_raw: u16,
25674 #[doc = "RC channel 10 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25675 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25676 pub chan10_raw: u16,
25677 #[doc = "RC channel 11 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25678 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25679 pub chan11_raw: u16,
25680 #[doc = "RC channel 12 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25681 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25682 pub chan12_raw: u16,
25683 #[doc = "RC channel 13 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25684 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25685 pub chan13_raw: u16,
25686 #[doc = "RC channel 14 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25687 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25688 pub chan14_raw: u16,
25689 #[doc = "RC channel 15 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25690 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25691 pub chan15_raw: u16,
25692 #[doc = "RC channel 16 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25693 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25694 pub chan16_raw: u16,
25695 #[doc = "RC channel 17 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25696 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25697 pub chan17_raw: u16,
25698 #[doc = "RC channel 18 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25699 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25700 pub chan18_raw: u16,
25701}
25702impl RC_CHANNELS_OVERRIDE_DATA {
25703 pub const ENCODED_LEN: usize = 38usize;
25704 pub const DEFAULT: Self = Self {
25705 chan1_raw: 0_u16,
25706 chan2_raw: 0_u16,
25707 chan3_raw: 0_u16,
25708 chan4_raw: 0_u16,
25709 chan5_raw: 0_u16,
25710 chan6_raw: 0_u16,
25711 chan7_raw: 0_u16,
25712 chan8_raw: 0_u16,
25713 target_system: 0_u8,
25714 target_component: 0_u8,
25715 chan9_raw: 0_u16,
25716 chan10_raw: 0_u16,
25717 chan11_raw: 0_u16,
25718 chan12_raw: 0_u16,
25719 chan13_raw: 0_u16,
25720 chan14_raw: 0_u16,
25721 chan15_raw: 0_u16,
25722 chan16_raw: 0_u16,
25723 chan17_raw: 0_u16,
25724 chan18_raw: 0_u16,
25725 };
25726 #[cfg(feature = "arbitrary")]
25727 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25728 use arbitrary::{Arbitrary, Unstructured};
25729 let mut buf = [0u8; 1024];
25730 rng.fill_bytes(&mut buf);
25731 let mut unstructured = Unstructured::new(&buf);
25732 Self::arbitrary(&mut unstructured).unwrap_or_default()
25733 }
25734}
25735impl Default for RC_CHANNELS_OVERRIDE_DATA {
25736 fn default() -> Self {
25737 Self::DEFAULT.clone()
25738 }
25739}
25740impl MessageData for RC_CHANNELS_OVERRIDE_DATA {
25741 type Message = MavMessage;
25742 const ID: u32 = 70u32;
25743 const NAME: &'static str = "RC_CHANNELS_OVERRIDE";
25744 const EXTRA_CRC: u8 = 124u8;
25745 const ENCODED_LEN: usize = 38usize;
25746 fn deser(
25747 _version: MavlinkVersion,
25748 __input: &[u8],
25749 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25750 let avail_len = __input.len();
25751 let mut payload_buf = [0; Self::ENCODED_LEN];
25752 let mut buf = if avail_len < Self::ENCODED_LEN {
25753 payload_buf[0..avail_len].copy_from_slice(__input);
25754 Bytes::new(&payload_buf)
25755 } else {
25756 Bytes::new(__input)
25757 };
25758 let mut __struct = Self::default();
25759 __struct.chan1_raw = buf.get_u16_le();
25760 __struct.chan2_raw = buf.get_u16_le();
25761 __struct.chan3_raw = buf.get_u16_le();
25762 __struct.chan4_raw = buf.get_u16_le();
25763 __struct.chan5_raw = buf.get_u16_le();
25764 __struct.chan6_raw = buf.get_u16_le();
25765 __struct.chan7_raw = buf.get_u16_le();
25766 __struct.chan8_raw = buf.get_u16_le();
25767 __struct.target_system = buf.get_u8();
25768 __struct.target_component = buf.get_u8();
25769 __struct.chan9_raw = buf.get_u16_le();
25770 __struct.chan10_raw = buf.get_u16_le();
25771 __struct.chan11_raw = buf.get_u16_le();
25772 __struct.chan12_raw = buf.get_u16_le();
25773 __struct.chan13_raw = buf.get_u16_le();
25774 __struct.chan14_raw = buf.get_u16_le();
25775 __struct.chan15_raw = buf.get_u16_le();
25776 __struct.chan16_raw = buf.get_u16_le();
25777 __struct.chan17_raw = buf.get_u16_le();
25778 __struct.chan18_raw = buf.get_u16_le();
25779 Ok(__struct)
25780 }
25781 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25782 let mut __tmp = BytesMut::new(bytes);
25783 #[allow(clippy::absurd_extreme_comparisons)]
25784 #[allow(unused_comparisons)]
25785 if __tmp.remaining() < Self::ENCODED_LEN {
25786 panic!(
25787 "buffer is too small (need {} bytes, but got {})",
25788 Self::ENCODED_LEN,
25789 __tmp.remaining(),
25790 )
25791 }
25792 __tmp.put_u16_le(self.chan1_raw);
25793 __tmp.put_u16_le(self.chan2_raw);
25794 __tmp.put_u16_le(self.chan3_raw);
25795 __tmp.put_u16_le(self.chan4_raw);
25796 __tmp.put_u16_le(self.chan5_raw);
25797 __tmp.put_u16_le(self.chan6_raw);
25798 __tmp.put_u16_le(self.chan7_raw);
25799 __tmp.put_u16_le(self.chan8_raw);
25800 __tmp.put_u8(self.target_system);
25801 __tmp.put_u8(self.target_component);
25802 if matches!(version, MavlinkVersion::V2) {
25803 __tmp.put_u16_le(self.chan9_raw);
25804 __tmp.put_u16_le(self.chan10_raw);
25805 __tmp.put_u16_le(self.chan11_raw);
25806 __tmp.put_u16_le(self.chan12_raw);
25807 __tmp.put_u16_le(self.chan13_raw);
25808 __tmp.put_u16_le(self.chan14_raw);
25809 __tmp.put_u16_le(self.chan15_raw);
25810 __tmp.put_u16_le(self.chan16_raw);
25811 __tmp.put_u16_le(self.chan17_raw);
25812 __tmp.put_u16_le(self.chan18_raw);
25813 let len = __tmp.len();
25814 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25815 } else {
25816 __tmp.len()
25817 }
25818 }
25819}
25820#[doc = "The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
25821#[doc = ""]
25822#[doc = "ID: 35"]
25823#[derive(Debug, Clone, PartialEq)]
25824#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25825#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25826#[cfg_attr(feature = "ts", derive(TS))]
25827#[cfg_attr(feature = "ts", ts(export))]
25828pub struct RC_CHANNELS_RAW_DATA {
25829 #[doc = "Timestamp (time since system boot)."]
25830 pub time_boot_ms: u32,
25831 #[doc = "RC channel 1 value."]
25832 pub chan1_raw: u16,
25833 #[doc = "RC channel 2 value."]
25834 pub chan2_raw: u16,
25835 #[doc = "RC channel 3 value."]
25836 pub chan3_raw: u16,
25837 #[doc = "RC channel 4 value."]
25838 pub chan4_raw: u16,
25839 #[doc = "RC channel 5 value."]
25840 pub chan5_raw: u16,
25841 #[doc = "RC channel 6 value."]
25842 pub chan6_raw: u16,
25843 #[doc = "RC channel 7 value."]
25844 pub chan7_raw: u16,
25845 #[doc = "RC channel 8 value."]
25846 pub chan8_raw: u16,
25847 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
25848 pub port: u8,
25849 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
25850 pub rssi: u8,
25851}
25852impl RC_CHANNELS_RAW_DATA {
25853 pub const ENCODED_LEN: usize = 22usize;
25854 pub const DEFAULT: Self = Self {
25855 time_boot_ms: 0_u32,
25856 chan1_raw: 0_u16,
25857 chan2_raw: 0_u16,
25858 chan3_raw: 0_u16,
25859 chan4_raw: 0_u16,
25860 chan5_raw: 0_u16,
25861 chan6_raw: 0_u16,
25862 chan7_raw: 0_u16,
25863 chan8_raw: 0_u16,
25864 port: 0_u8,
25865 rssi: 0_u8,
25866 };
25867 #[cfg(feature = "arbitrary")]
25868 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25869 use arbitrary::{Arbitrary, Unstructured};
25870 let mut buf = [0u8; 1024];
25871 rng.fill_bytes(&mut buf);
25872 let mut unstructured = Unstructured::new(&buf);
25873 Self::arbitrary(&mut unstructured).unwrap_or_default()
25874 }
25875}
25876impl Default for RC_CHANNELS_RAW_DATA {
25877 fn default() -> Self {
25878 Self::DEFAULT.clone()
25879 }
25880}
25881impl MessageData for RC_CHANNELS_RAW_DATA {
25882 type Message = MavMessage;
25883 const ID: u32 = 35u32;
25884 const NAME: &'static str = "RC_CHANNELS_RAW";
25885 const EXTRA_CRC: u8 = 244u8;
25886 const ENCODED_LEN: usize = 22usize;
25887 fn deser(
25888 _version: MavlinkVersion,
25889 __input: &[u8],
25890 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25891 let avail_len = __input.len();
25892 let mut payload_buf = [0; Self::ENCODED_LEN];
25893 let mut buf = if avail_len < Self::ENCODED_LEN {
25894 payload_buf[0..avail_len].copy_from_slice(__input);
25895 Bytes::new(&payload_buf)
25896 } else {
25897 Bytes::new(__input)
25898 };
25899 let mut __struct = Self::default();
25900 __struct.time_boot_ms = buf.get_u32_le();
25901 __struct.chan1_raw = buf.get_u16_le();
25902 __struct.chan2_raw = buf.get_u16_le();
25903 __struct.chan3_raw = buf.get_u16_le();
25904 __struct.chan4_raw = buf.get_u16_le();
25905 __struct.chan5_raw = buf.get_u16_le();
25906 __struct.chan6_raw = buf.get_u16_le();
25907 __struct.chan7_raw = buf.get_u16_le();
25908 __struct.chan8_raw = buf.get_u16_le();
25909 __struct.port = buf.get_u8();
25910 __struct.rssi = buf.get_u8();
25911 Ok(__struct)
25912 }
25913 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25914 let mut __tmp = BytesMut::new(bytes);
25915 #[allow(clippy::absurd_extreme_comparisons)]
25916 #[allow(unused_comparisons)]
25917 if __tmp.remaining() < Self::ENCODED_LEN {
25918 panic!(
25919 "buffer is too small (need {} bytes, but got {})",
25920 Self::ENCODED_LEN,
25921 __tmp.remaining(),
25922 )
25923 }
25924 __tmp.put_u32_le(self.time_boot_ms);
25925 __tmp.put_u16_le(self.chan1_raw);
25926 __tmp.put_u16_le(self.chan2_raw);
25927 __tmp.put_u16_le(self.chan3_raw);
25928 __tmp.put_u16_le(self.chan4_raw);
25929 __tmp.put_u16_le(self.chan5_raw);
25930 __tmp.put_u16_le(self.chan6_raw);
25931 __tmp.put_u16_le(self.chan7_raw);
25932 __tmp.put_u16_le(self.chan8_raw);
25933 __tmp.put_u8(self.port);
25934 __tmp.put_u8(self.rssi);
25935 if matches!(version, MavlinkVersion::V2) {
25936 let len = __tmp.len();
25937 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25938 } else {
25939 __tmp.len()
25940 }
25941 }
25942}
25943#[doc = "The scaled values of the RC channels received: (-100%) -10000, (0%) 0, (100%) 10000. Channels that are inactive should be set to INT16_MAX."]
25944#[doc = ""]
25945#[doc = "ID: 34"]
25946#[derive(Debug, Clone, PartialEq)]
25947#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25948#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25949#[cfg_attr(feature = "ts", derive(TS))]
25950#[cfg_attr(feature = "ts", ts(export))]
25951pub struct RC_CHANNELS_SCALED_DATA {
25952 #[doc = "Timestamp (time since system boot)."]
25953 pub time_boot_ms: u32,
25954 #[doc = "RC channel 1 value scaled."]
25955 pub chan1_scaled: i16,
25956 #[doc = "RC channel 2 value scaled."]
25957 pub chan2_scaled: i16,
25958 #[doc = "RC channel 3 value scaled."]
25959 pub chan3_scaled: i16,
25960 #[doc = "RC channel 4 value scaled."]
25961 pub chan4_scaled: i16,
25962 #[doc = "RC channel 5 value scaled."]
25963 pub chan5_scaled: i16,
25964 #[doc = "RC channel 6 value scaled."]
25965 pub chan6_scaled: i16,
25966 #[doc = "RC channel 7 value scaled."]
25967 pub chan7_scaled: i16,
25968 #[doc = "RC channel 8 value scaled."]
25969 pub chan8_scaled: i16,
25970 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
25971 pub port: u8,
25972 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
25973 pub rssi: u8,
25974}
25975impl RC_CHANNELS_SCALED_DATA {
25976 pub const ENCODED_LEN: usize = 22usize;
25977 pub const DEFAULT: Self = Self {
25978 time_boot_ms: 0_u32,
25979 chan1_scaled: 0_i16,
25980 chan2_scaled: 0_i16,
25981 chan3_scaled: 0_i16,
25982 chan4_scaled: 0_i16,
25983 chan5_scaled: 0_i16,
25984 chan6_scaled: 0_i16,
25985 chan7_scaled: 0_i16,
25986 chan8_scaled: 0_i16,
25987 port: 0_u8,
25988 rssi: 0_u8,
25989 };
25990 #[cfg(feature = "arbitrary")]
25991 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25992 use arbitrary::{Arbitrary, Unstructured};
25993 let mut buf = [0u8; 1024];
25994 rng.fill_bytes(&mut buf);
25995 let mut unstructured = Unstructured::new(&buf);
25996 Self::arbitrary(&mut unstructured).unwrap_or_default()
25997 }
25998}
25999impl Default for RC_CHANNELS_SCALED_DATA {
26000 fn default() -> Self {
26001 Self::DEFAULT.clone()
26002 }
26003}
26004impl MessageData for RC_CHANNELS_SCALED_DATA {
26005 type Message = MavMessage;
26006 const ID: u32 = 34u32;
26007 const NAME: &'static str = "RC_CHANNELS_SCALED";
26008 const EXTRA_CRC: u8 = 237u8;
26009 const ENCODED_LEN: usize = 22usize;
26010 fn deser(
26011 _version: MavlinkVersion,
26012 __input: &[u8],
26013 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26014 let avail_len = __input.len();
26015 let mut payload_buf = [0; Self::ENCODED_LEN];
26016 let mut buf = if avail_len < Self::ENCODED_LEN {
26017 payload_buf[0..avail_len].copy_from_slice(__input);
26018 Bytes::new(&payload_buf)
26019 } else {
26020 Bytes::new(__input)
26021 };
26022 let mut __struct = Self::default();
26023 __struct.time_boot_ms = buf.get_u32_le();
26024 __struct.chan1_scaled = buf.get_i16_le();
26025 __struct.chan2_scaled = buf.get_i16_le();
26026 __struct.chan3_scaled = buf.get_i16_le();
26027 __struct.chan4_scaled = buf.get_i16_le();
26028 __struct.chan5_scaled = buf.get_i16_le();
26029 __struct.chan6_scaled = buf.get_i16_le();
26030 __struct.chan7_scaled = buf.get_i16_le();
26031 __struct.chan8_scaled = buf.get_i16_le();
26032 __struct.port = buf.get_u8();
26033 __struct.rssi = buf.get_u8();
26034 Ok(__struct)
26035 }
26036 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26037 let mut __tmp = BytesMut::new(bytes);
26038 #[allow(clippy::absurd_extreme_comparisons)]
26039 #[allow(unused_comparisons)]
26040 if __tmp.remaining() < Self::ENCODED_LEN {
26041 panic!(
26042 "buffer is too small (need {} bytes, but got {})",
26043 Self::ENCODED_LEN,
26044 __tmp.remaining(),
26045 )
26046 }
26047 __tmp.put_u32_le(self.time_boot_ms);
26048 __tmp.put_i16_le(self.chan1_scaled);
26049 __tmp.put_i16_le(self.chan2_scaled);
26050 __tmp.put_i16_le(self.chan3_scaled);
26051 __tmp.put_i16_le(self.chan4_scaled);
26052 __tmp.put_i16_le(self.chan5_scaled);
26053 __tmp.put_i16_le(self.chan6_scaled);
26054 __tmp.put_i16_le(self.chan7_scaled);
26055 __tmp.put_i16_le(self.chan8_scaled);
26056 __tmp.put_u8(self.port);
26057 __tmp.put_u8(self.rssi);
26058 if matches!(version, MavlinkVersion::V2) {
26059 let len = __tmp.len();
26060 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26061 } else {
26062 __tmp.len()
26063 }
26064 }
26065}
26066#[deprecated = " See `MAV_CMD_SET_MESSAGE_INTERVAL ` (Deprecated since 2015-08)"]
26067#[doc = "Request a data stream."]
26068#[doc = ""]
26069#[doc = "ID: 66"]
26070#[derive(Debug, Clone, PartialEq)]
26071#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26072#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26073#[cfg_attr(feature = "ts", derive(TS))]
26074#[cfg_attr(feature = "ts", ts(export))]
26075pub struct REQUEST_DATA_STREAM_DATA {
26076 #[doc = "The requested message rate"]
26077 pub req_message_rate: u16,
26078 #[doc = "The target requested to send the message stream."]
26079 pub target_system: u8,
26080 #[doc = "The target requested to send the message stream."]
26081 pub target_component: u8,
26082 #[doc = "The ID of the requested data stream"]
26083 pub req_stream_id: u8,
26084 #[doc = "1 to start sending, 0 to stop sending."]
26085 pub start_stop: u8,
26086}
26087impl REQUEST_DATA_STREAM_DATA {
26088 pub const ENCODED_LEN: usize = 6usize;
26089 pub const DEFAULT: Self = Self {
26090 req_message_rate: 0_u16,
26091 target_system: 0_u8,
26092 target_component: 0_u8,
26093 req_stream_id: 0_u8,
26094 start_stop: 0_u8,
26095 };
26096 #[cfg(feature = "arbitrary")]
26097 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26098 use arbitrary::{Arbitrary, Unstructured};
26099 let mut buf = [0u8; 1024];
26100 rng.fill_bytes(&mut buf);
26101 let mut unstructured = Unstructured::new(&buf);
26102 Self::arbitrary(&mut unstructured).unwrap_or_default()
26103 }
26104}
26105impl Default for REQUEST_DATA_STREAM_DATA {
26106 fn default() -> Self {
26107 Self::DEFAULT.clone()
26108 }
26109}
26110impl MessageData for REQUEST_DATA_STREAM_DATA {
26111 type Message = MavMessage;
26112 const ID: u32 = 66u32;
26113 const NAME: &'static str = "REQUEST_DATA_STREAM";
26114 const EXTRA_CRC: u8 = 148u8;
26115 const ENCODED_LEN: usize = 6usize;
26116 fn deser(
26117 _version: MavlinkVersion,
26118 __input: &[u8],
26119 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26120 let avail_len = __input.len();
26121 let mut payload_buf = [0; Self::ENCODED_LEN];
26122 let mut buf = if avail_len < Self::ENCODED_LEN {
26123 payload_buf[0..avail_len].copy_from_slice(__input);
26124 Bytes::new(&payload_buf)
26125 } else {
26126 Bytes::new(__input)
26127 };
26128 let mut __struct = Self::default();
26129 __struct.req_message_rate = buf.get_u16_le();
26130 __struct.target_system = buf.get_u8();
26131 __struct.target_component = buf.get_u8();
26132 __struct.req_stream_id = buf.get_u8();
26133 __struct.start_stop = buf.get_u8();
26134 Ok(__struct)
26135 }
26136 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26137 let mut __tmp = BytesMut::new(bytes);
26138 #[allow(clippy::absurd_extreme_comparisons)]
26139 #[allow(unused_comparisons)]
26140 if __tmp.remaining() < Self::ENCODED_LEN {
26141 panic!(
26142 "buffer is too small (need {} bytes, but got {})",
26143 Self::ENCODED_LEN,
26144 __tmp.remaining(),
26145 )
26146 }
26147 __tmp.put_u16_le(self.req_message_rate);
26148 __tmp.put_u8(self.target_system);
26149 __tmp.put_u8(self.target_component);
26150 __tmp.put_u8(self.req_stream_id);
26151 __tmp.put_u8(self.start_stop);
26152 if matches!(version, MavlinkVersion::V2) {
26153 let len = __tmp.len();
26154 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26155 } else {
26156 __tmp.len()
26157 }
26158 }
26159}
26160#[doc = "Request one or more events to be (re-)sent. If first_sequence==last_sequence, only a single event is requested. Note that first_sequence can be larger than last_sequence (because the sequence number can wrap). Each sequence will trigger an EVENT or EVENT_ERROR response."]
26161#[doc = ""]
26162#[doc = "ID: 412"]
26163#[derive(Debug, Clone, PartialEq)]
26164#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26165#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26166#[cfg_attr(feature = "ts", derive(TS))]
26167#[cfg_attr(feature = "ts", ts(export))]
26168pub struct REQUEST_EVENT_DATA {
26169 #[doc = "First sequence number of the requested event."]
26170 pub first_sequence: u16,
26171 #[doc = "Last sequence number of the requested event."]
26172 pub last_sequence: u16,
26173 #[doc = "System ID"]
26174 pub target_system: u8,
26175 #[doc = "Component ID"]
26176 pub target_component: u8,
26177}
26178impl REQUEST_EVENT_DATA {
26179 pub const ENCODED_LEN: usize = 6usize;
26180 pub const DEFAULT: Self = Self {
26181 first_sequence: 0_u16,
26182 last_sequence: 0_u16,
26183 target_system: 0_u8,
26184 target_component: 0_u8,
26185 };
26186 #[cfg(feature = "arbitrary")]
26187 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26188 use arbitrary::{Arbitrary, Unstructured};
26189 let mut buf = [0u8; 1024];
26190 rng.fill_bytes(&mut buf);
26191 let mut unstructured = Unstructured::new(&buf);
26192 Self::arbitrary(&mut unstructured).unwrap_or_default()
26193 }
26194}
26195impl Default for REQUEST_EVENT_DATA {
26196 fn default() -> Self {
26197 Self::DEFAULT.clone()
26198 }
26199}
26200impl MessageData for REQUEST_EVENT_DATA {
26201 type Message = MavMessage;
26202 const ID: u32 = 412u32;
26203 const NAME: &'static str = "REQUEST_EVENT";
26204 const EXTRA_CRC: u8 = 33u8;
26205 const ENCODED_LEN: usize = 6usize;
26206 fn deser(
26207 _version: MavlinkVersion,
26208 __input: &[u8],
26209 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26210 let avail_len = __input.len();
26211 let mut payload_buf = [0; Self::ENCODED_LEN];
26212 let mut buf = if avail_len < Self::ENCODED_LEN {
26213 payload_buf[0..avail_len].copy_from_slice(__input);
26214 Bytes::new(&payload_buf)
26215 } else {
26216 Bytes::new(__input)
26217 };
26218 let mut __struct = Self::default();
26219 __struct.first_sequence = buf.get_u16_le();
26220 __struct.last_sequence = buf.get_u16_le();
26221 __struct.target_system = buf.get_u8();
26222 __struct.target_component = buf.get_u8();
26223 Ok(__struct)
26224 }
26225 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26226 let mut __tmp = BytesMut::new(bytes);
26227 #[allow(clippy::absurd_extreme_comparisons)]
26228 #[allow(unused_comparisons)]
26229 if __tmp.remaining() < Self::ENCODED_LEN {
26230 panic!(
26231 "buffer is too small (need {} bytes, but got {})",
26232 Self::ENCODED_LEN,
26233 __tmp.remaining(),
26234 )
26235 }
26236 __tmp.put_u16_le(self.first_sequence);
26237 __tmp.put_u16_le(self.last_sequence);
26238 __tmp.put_u8(self.target_system);
26239 __tmp.put_u8(self.target_component);
26240 if matches!(version, MavlinkVersion::V2) {
26241 let len = __tmp.len();
26242 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26243 } else {
26244 __tmp.len()
26245 }
26246 }
26247}
26248#[doc = "The autopilot is requesting a resource (file, binary, other type of data)."]
26249#[doc = ""]
26250#[doc = "ID: 142"]
26251#[derive(Debug, Clone, PartialEq)]
26252#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26253#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26254#[cfg_attr(feature = "ts", derive(TS))]
26255#[cfg_attr(feature = "ts", ts(export))]
26256pub struct RESOURCE_REQUEST_DATA {
26257 #[doc = "Request ID. This ID should be re-used when sending back URI contents"]
26258 pub request_id: u8,
26259 #[doc = "The type of requested URI. 0 = a file via URL. 1 = a UAVCAN binary"]
26260 pub uri_type: u8,
26261 #[doc = "The requested unique resource identifier (URI). It is not necessarily a straight domain name (depends on the URI type enum)"]
26262 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
26263 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
26264 pub uri: [u8; 120],
26265 #[doc = "The way the autopilot wants to receive the URI. 0 = MAVLink FTP. 1 = binary stream."]
26266 pub transfer_type: u8,
26267 #[doc = "The storage path the autopilot wants the URI to be stored in. Will only be valid if the transfer_type has a storage associated (e.g. MAVLink FTP)."]
26268 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
26269 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
26270 pub storage: [u8; 120],
26271}
26272impl RESOURCE_REQUEST_DATA {
26273 pub const ENCODED_LEN: usize = 243usize;
26274 pub const DEFAULT: Self = Self {
26275 request_id: 0_u8,
26276 uri_type: 0_u8,
26277 uri: [0_u8; 120usize],
26278 transfer_type: 0_u8,
26279 storage: [0_u8; 120usize],
26280 };
26281 #[cfg(feature = "arbitrary")]
26282 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26283 use arbitrary::{Arbitrary, Unstructured};
26284 let mut buf = [0u8; 1024];
26285 rng.fill_bytes(&mut buf);
26286 let mut unstructured = Unstructured::new(&buf);
26287 Self::arbitrary(&mut unstructured).unwrap_or_default()
26288 }
26289}
26290impl Default for RESOURCE_REQUEST_DATA {
26291 fn default() -> Self {
26292 Self::DEFAULT.clone()
26293 }
26294}
26295impl MessageData for RESOURCE_REQUEST_DATA {
26296 type Message = MavMessage;
26297 const ID: u32 = 142u32;
26298 const NAME: &'static str = "RESOURCE_REQUEST";
26299 const EXTRA_CRC: u8 = 72u8;
26300 const ENCODED_LEN: usize = 243usize;
26301 fn deser(
26302 _version: MavlinkVersion,
26303 __input: &[u8],
26304 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26305 let avail_len = __input.len();
26306 let mut payload_buf = [0; Self::ENCODED_LEN];
26307 let mut buf = if avail_len < Self::ENCODED_LEN {
26308 payload_buf[0..avail_len].copy_from_slice(__input);
26309 Bytes::new(&payload_buf)
26310 } else {
26311 Bytes::new(__input)
26312 };
26313 let mut __struct = Self::default();
26314 __struct.request_id = buf.get_u8();
26315 __struct.uri_type = buf.get_u8();
26316 for v in &mut __struct.uri {
26317 let val = buf.get_u8();
26318 *v = val;
26319 }
26320 __struct.transfer_type = buf.get_u8();
26321 for v in &mut __struct.storage {
26322 let val = buf.get_u8();
26323 *v = val;
26324 }
26325 Ok(__struct)
26326 }
26327 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26328 let mut __tmp = BytesMut::new(bytes);
26329 #[allow(clippy::absurd_extreme_comparisons)]
26330 #[allow(unused_comparisons)]
26331 if __tmp.remaining() < Self::ENCODED_LEN {
26332 panic!(
26333 "buffer is too small (need {} bytes, but got {})",
26334 Self::ENCODED_LEN,
26335 __tmp.remaining(),
26336 )
26337 }
26338 __tmp.put_u8(self.request_id);
26339 __tmp.put_u8(self.uri_type);
26340 for val in &self.uri {
26341 __tmp.put_u8(*val);
26342 }
26343 __tmp.put_u8(self.transfer_type);
26344 for val in &self.storage {
26345 __tmp.put_u8(*val);
26346 }
26347 if matches!(version, MavlinkVersion::V2) {
26348 let len = __tmp.len();
26349 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26350 } else {
26351 __tmp.len()
26352 }
26353 }
26354}
26355#[doc = "Response to a REQUEST_EVENT in case of an error (e.g. the event is not available anymore)."]
26356#[doc = ""]
26357#[doc = "ID: 413"]
26358#[derive(Debug, Clone, PartialEq)]
26359#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26360#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26361#[cfg_attr(feature = "ts", derive(TS))]
26362#[cfg_attr(feature = "ts", ts(export))]
26363pub struct RESPONSE_EVENT_ERROR_DATA {
26364 #[doc = "Sequence number."]
26365 pub sequence: u16,
26366 #[doc = "Oldest Sequence number that is still available after the sequence set in REQUEST_EVENT."]
26367 pub sequence_oldest_available: u16,
26368 #[doc = "System ID"]
26369 pub target_system: u8,
26370 #[doc = "Component ID"]
26371 pub target_component: u8,
26372 #[doc = "Error reason."]
26373 pub reason: MavEventErrorReason,
26374}
26375impl RESPONSE_EVENT_ERROR_DATA {
26376 pub const ENCODED_LEN: usize = 7usize;
26377 pub const DEFAULT: Self = Self {
26378 sequence: 0_u16,
26379 sequence_oldest_available: 0_u16,
26380 target_system: 0_u8,
26381 target_component: 0_u8,
26382 reason: MavEventErrorReason::DEFAULT,
26383 };
26384 #[cfg(feature = "arbitrary")]
26385 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26386 use arbitrary::{Arbitrary, Unstructured};
26387 let mut buf = [0u8; 1024];
26388 rng.fill_bytes(&mut buf);
26389 let mut unstructured = Unstructured::new(&buf);
26390 Self::arbitrary(&mut unstructured).unwrap_or_default()
26391 }
26392}
26393impl Default for RESPONSE_EVENT_ERROR_DATA {
26394 fn default() -> Self {
26395 Self::DEFAULT.clone()
26396 }
26397}
26398impl MessageData for RESPONSE_EVENT_ERROR_DATA {
26399 type Message = MavMessage;
26400 const ID: u32 = 413u32;
26401 const NAME: &'static str = "RESPONSE_EVENT_ERROR";
26402 const EXTRA_CRC: u8 = 77u8;
26403 const ENCODED_LEN: usize = 7usize;
26404 fn deser(
26405 _version: MavlinkVersion,
26406 __input: &[u8],
26407 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26408 let avail_len = __input.len();
26409 let mut payload_buf = [0; Self::ENCODED_LEN];
26410 let mut buf = if avail_len < Self::ENCODED_LEN {
26411 payload_buf[0..avail_len].copy_from_slice(__input);
26412 Bytes::new(&payload_buf)
26413 } else {
26414 Bytes::new(__input)
26415 };
26416 let mut __struct = Self::default();
26417 __struct.sequence = buf.get_u16_le();
26418 __struct.sequence_oldest_available = buf.get_u16_le();
26419 __struct.target_system = buf.get_u8();
26420 __struct.target_component = buf.get_u8();
26421 let tmp = buf.get_u8();
26422 __struct.reason =
26423 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
26424 enum_type: "MavEventErrorReason",
26425 value: tmp as u64,
26426 })?;
26427 Ok(__struct)
26428 }
26429 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26430 let mut __tmp = BytesMut::new(bytes);
26431 #[allow(clippy::absurd_extreme_comparisons)]
26432 #[allow(unused_comparisons)]
26433 if __tmp.remaining() < Self::ENCODED_LEN {
26434 panic!(
26435 "buffer is too small (need {} bytes, but got {})",
26436 Self::ENCODED_LEN,
26437 __tmp.remaining(),
26438 )
26439 }
26440 __tmp.put_u16_le(self.sequence);
26441 __tmp.put_u16_le(self.sequence_oldest_available);
26442 __tmp.put_u8(self.target_system);
26443 __tmp.put_u8(self.target_component);
26444 __tmp.put_u8(self.reason as u8);
26445 if matches!(version, MavlinkVersion::V2) {
26446 let len = __tmp.len();
26447 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26448 } else {
26449 __tmp.len()
26450 }
26451 }
26452}
26453#[doc = "Read out the safety zone the MAV currently assumes."]
26454#[doc = ""]
26455#[doc = "ID: 55"]
26456#[derive(Debug, Clone, PartialEq)]
26457#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26458#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26459#[cfg_attr(feature = "ts", derive(TS))]
26460#[cfg_attr(feature = "ts", ts(export))]
26461pub struct SAFETY_ALLOWED_AREA_DATA {
26462 #[doc = "x position 1 / Latitude 1"]
26463 pub p1x: f32,
26464 #[doc = "y position 1 / Longitude 1"]
26465 pub p1y: f32,
26466 #[doc = "z position 1 / Altitude 1"]
26467 pub p1z: f32,
26468 #[doc = "x position 2 / Latitude 2"]
26469 pub p2x: f32,
26470 #[doc = "y position 2 / Longitude 2"]
26471 pub p2y: f32,
26472 #[doc = "z position 2 / Altitude 2"]
26473 pub p2z: f32,
26474 #[doc = "Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down."]
26475 pub frame: MavFrame,
26476}
26477impl SAFETY_ALLOWED_AREA_DATA {
26478 pub const ENCODED_LEN: usize = 25usize;
26479 pub const DEFAULT: Self = Self {
26480 p1x: 0.0_f32,
26481 p1y: 0.0_f32,
26482 p1z: 0.0_f32,
26483 p2x: 0.0_f32,
26484 p2y: 0.0_f32,
26485 p2z: 0.0_f32,
26486 frame: MavFrame::DEFAULT,
26487 };
26488 #[cfg(feature = "arbitrary")]
26489 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26490 use arbitrary::{Arbitrary, Unstructured};
26491 let mut buf = [0u8; 1024];
26492 rng.fill_bytes(&mut buf);
26493 let mut unstructured = Unstructured::new(&buf);
26494 Self::arbitrary(&mut unstructured).unwrap_or_default()
26495 }
26496}
26497impl Default for SAFETY_ALLOWED_AREA_DATA {
26498 fn default() -> Self {
26499 Self::DEFAULT.clone()
26500 }
26501}
26502impl MessageData for SAFETY_ALLOWED_AREA_DATA {
26503 type Message = MavMessage;
26504 const ID: u32 = 55u32;
26505 const NAME: &'static str = "SAFETY_ALLOWED_AREA";
26506 const EXTRA_CRC: u8 = 3u8;
26507 const ENCODED_LEN: usize = 25usize;
26508 fn deser(
26509 _version: MavlinkVersion,
26510 __input: &[u8],
26511 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26512 let avail_len = __input.len();
26513 let mut payload_buf = [0; Self::ENCODED_LEN];
26514 let mut buf = if avail_len < Self::ENCODED_LEN {
26515 payload_buf[0..avail_len].copy_from_slice(__input);
26516 Bytes::new(&payload_buf)
26517 } else {
26518 Bytes::new(__input)
26519 };
26520 let mut __struct = Self::default();
26521 __struct.p1x = buf.get_f32_le();
26522 __struct.p1y = buf.get_f32_le();
26523 __struct.p1z = buf.get_f32_le();
26524 __struct.p2x = buf.get_f32_le();
26525 __struct.p2y = buf.get_f32_le();
26526 __struct.p2z = buf.get_f32_le();
26527 let tmp = buf.get_u8();
26528 __struct.frame =
26529 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
26530 enum_type: "MavFrame",
26531 value: tmp as u64,
26532 })?;
26533 Ok(__struct)
26534 }
26535 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26536 let mut __tmp = BytesMut::new(bytes);
26537 #[allow(clippy::absurd_extreme_comparisons)]
26538 #[allow(unused_comparisons)]
26539 if __tmp.remaining() < Self::ENCODED_LEN {
26540 panic!(
26541 "buffer is too small (need {} bytes, but got {})",
26542 Self::ENCODED_LEN,
26543 __tmp.remaining(),
26544 )
26545 }
26546 __tmp.put_f32_le(self.p1x);
26547 __tmp.put_f32_le(self.p1y);
26548 __tmp.put_f32_le(self.p1z);
26549 __tmp.put_f32_le(self.p2x);
26550 __tmp.put_f32_le(self.p2y);
26551 __tmp.put_f32_le(self.p2z);
26552 __tmp.put_u8(self.frame as u8);
26553 if matches!(version, MavlinkVersion::V2) {
26554 let len = __tmp.len();
26555 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26556 } else {
26557 __tmp.len()
26558 }
26559 }
26560}
26561#[doc = "Set a safety zone (volume), which is defined by two corners of a cube. This message can be used to tell the MAV which setpoints/waypoints to accept and which to reject. Safety areas are often enforced by national or competition regulations."]
26562#[doc = ""]
26563#[doc = "ID: 54"]
26564#[derive(Debug, Clone, PartialEq)]
26565#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26566#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26567#[cfg_attr(feature = "ts", derive(TS))]
26568#[cfg_attr(feature = "ts", ts(export))]
26569pub struct SAFETY_SET_ALLOWED_AREA_DATA {
26570 #[doc = "x position 1 / Latitude 1"]
26571 pub p1x: f32,
26572 #[doc = "y position 1 / Longitude 1"]
26573 pub p1y: f32,
26574 #[doc = "z position 1 / Altitude 1"]
26575 pub p1z: f32,
26576 #[doc = "x position 2 / Latitude 2"]
26577 pub p2x: f32,
26578 #[doc = "y position 2 / Longitude 2"]
26579 pub p2y: f32,
26580 #[doc = "z position 2 / Altitude 2"]
26581 pub p2z: f32,
26582 #[doc = "System ID"]
26583 pub target_system: u8,
26584 #[doc = "Component ID"]
26585 pub target_component: u8,
26586 #[doc = "Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down."]
26587 pub frame: MavFrame,
26588}
26589impl SAFETY_SET_ALLOWED_AREA_DATA {
26590 pub const ENCODED_LEN: usize = 27usize;
26591 pub const DEFAULT: Self = Self {
26592 p1x: 0.0_f32,
26593 p1y: 0.0_f32,
26594 p1z: 0.0_f32,
26595 p2x: 0.0_f32,
26596 p2y: 0.0_f32,
26597 p2z: 0.0_f32,
26598 target_system: 0_u8,
26599 target_component: 0_u8,
26600 frame: MavFrame::DEFAULT,
26601 };
26602 #[cfg(feature = "arbitrary")]
26603 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26604 use arbitrary::{Arbitrary, Unstructured};
26605 let mut buf = [0u8; 1024];
26606 rng.fill_bytes(&mut buf);
26607 let mut unstructured = Unstructured::new(&buf);
26608 Self::arbitrary(&mut unstructured).unwrap_or_default()
26609 }
26610}
26611impl Default for SAFETY_SET_ALLOWED_AREA_DATA {
26612 fn default() -> Self {
26613 Self::DEFAULT.clone()
26614 }
26615}
26616impl MessageData for SAFETY_SET_ALLOWED_AREA_DATA {
26617 type Message = MavMessage;
26618 const ID: u32 = 54u32;
26619 const NAME: &'static str = "SAFETY_SET_ALLOWED_AREA";
26620 const EXTRA_CRC: u8 = 15u8;
26621 const ENCODED_LEN: usize = 27usize;
26622 fn deser(
26623 _version: MavlinkVersion,
26624 __input: &[u8],
26625 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26626 let avail_len = __input.len();
26627 let mut payload_buf = [0; Self::ENCODED_LEN];
26628 let mut buf = if avail_len < Self::ENCODED_LEN {
26629 payload_buf[0..avail_len].copy_from_slice(__input);
26630 Bytes::new(&payload_buf)
26631 } else {
26632 Bytes::new(__input)
26633 };
26634 let mut __struct = Self::default();
26635 __struct.p1x = buf.get_f32_le();
26636 __struct.p1y = buf.get_f32_le();
26637 __struct.p1z = buf.get_f32_le();
26638 __struct.p2x = buf.get_f32_le();
26639 __struct.p2y = buf.get_f32_le();
26640 __struct.p2z = buf.get_f32_le();
26641 __struct.target_system = buf.get_u8();
26642 __struct.target_component = buf.get_u8();
26643 let tmp = buf.get_u8();
26644 __struct.frame =
26645 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
26646 enum_type: "MavFrame",
26647 value: tmp as u64,
26648 })?;
26649 Ok(__struct)
26650 }
26651 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26652 let mut __tmp = BytesMut::new(bytes);
26653 #[allow(clippy::absurd_extreme_comparisons)]
26654 #[allow(unused_comparisons)]
26655 if __tmp.remaining() < Self::ENCODED_LEN {
26656 panic!(
26657 "buffer is too small (need {} bytes, but got {})",
26658 Self::ENCODED_LEN,
26659 __tmp.remaining(),
26660 )
26661 }
26662 __tmp.put_f32_le(self.p1x);
26663 __tmp.put_f32_le(self.p1y);
26664 __tmp.put_f32_le(self.p1z);
26665 __tmp.put_f32_le(self.p2x);
26666 __tmp.put_f32_le(self.p2y);
26667 __tmp.put_f32_le(self.p2z);
26668 __tmp.put_u8(self.target_system);
26669 __tmp.put_u8(self.target_component);
26670 __tmp.put_u8(self.frame as u8);
26671 if matches!(version, MavlinkVersion::V2) {
26672 let len = __tmp.len();
26673 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26674 } else {
26675 __tmp.len()
26676 }
26677 }
26678}
26679#[doc = "The RAW IMU readings for the usual 9DOF sensor setup. This message should contain the scaled values to the described units."]
26680#[doc = ""]
26681#[doc = "ID: 26"]
26682#[derive(Debug, Clone, PartialEq)]
26683#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26684#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26685#[cfg_attr(feature = "ts", derive(TS))]
26686#[cfg_attr(feature = "ts", ts(export))]
26687pub struct SCALED_IMU_DATA {
26688 #[doc = "Timestamp (time since system boot)."]
26689 pub time_boot_ms: u32,
26690 #[doc = "X acceleration"]
26691 pub xacc: i16,
26692 #[doc = "Y acceleration"]
26693 pub yacc: i16,
26694 #[doc = "Z acceleration"]
26695 pub zacc: i16,
26696 #[doc = "Angular speed around X axis"]
26697 pub xgyro: i16,
26698 #[doc = "Angular speed around Y axis"]
26699 pub ygyro: i16,
26700 #[doc = "Angular speed around Z axis"]
26701 pub zgyro: i16,
26702 #[doc = "X Magnetic field"]
26703 pub xmag: i16,
26704 #[doc = "Y Magnetic field"]
26705 pub ymag: i16,
26706 #[doc = "Z Magnetic field"]
26707 pub zmag: i16,
26708 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
26709 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26710 pub temperature: i16,
26711}
26712impl SCALED_IMU_DATA {
26713 pub const ENCODED_LEN: usize = 24usize;
26714 pub const DEFAULT: Self = Self {
26715 time_boot_ms: 0_u32,
26716 xacc: 0_i16,
26717 yacc: 0_i16,
26718 zacc: 0_i16,
26719 xgyro: 0_i16,
26720 ygyro: 0_i16,
26721 zgyro: 0_i16,
26722 xmag: 0_i16,
26723 ymag: 0_i16,
26724 zmag: 0_i16,
26725 temperature: 0_i16,
26726 };
26727 #[cfg(feature = "arbitrary")]
26728 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26729 use arbitrary::{Arbitrary, Unstructured};
26730 let mut buf = [0u8; 1024];
26731 rng.fill_bytes(&mut buf);
26732 let mut unstructured = Unstructured::new(&buf);
26733 Self::arbitrary(&mut unstructured).unwrap_or_default()
26734 }
26735}
26736impl Default for SCALED_IMU_DATA {
26737 fn default() -> Self {
26738 Self::DEFAULT.clone()
26739 }
26740}
26741impl MessageData for SCALED_IMU_DATA {
26742 type Message = MavMessage;
26743 const ID: u32 = 26u32;
26744 const NAME: &'static str = "SCALED_IMU";
26745 const EXTRA_CRC: u8 = 170u8;
26746 const ENCODED_LEN: usize = 24usize;
26747 fn deser(
26748 _version: MavlinkVersion,
26749 __input: &[u8],
26750 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26751 let avail_len = __input.len();
26752 let mut payload_buf = [0; Self::ENCODED_LEN];
26753 let mut buf = if avail_len < Self::ENCODED_LEN {
26754 payload_buf[0..avail_len].copy_from_slice(__input);
26755 Bytes::new(&payload_buf)
26756 } else {
26757 Bytes::new(__input)
26758 };
26759 let mut __struct = Self::default();
26760 __struct.time_boot_ms = buf.get_u32_le();
26761 __struct.xacc = buf.get_i16_le();
26762 __struct.yacc = buf.get_i16_le();
26763 __struct.zacc = buf.get_i16_le();
26764 __struct.xgyro = buf.get_i16_le();
26765 __struct.ygyro = buf.get_i16_le();
26766 __struct.zgyro = buf.get_i16_le();
26767 __struct.xmag = buf.get_i16_le();
26768 __struct.ymag = buf.get_i16_le();
26769 __struct.zmag = buf.get_i16_le();
26770 __struct.temperature = buf.get_i16_le();
26771 Ok(__struct)
26772 }
26773 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26774 let mut __tmp = BytesMut::new(bytes);
26775 #[allow(clippy::absurd_extreme_comparisons)]
26776 #[allow(unused_comparisons)]
26777 if __tmp.remaining() < Self::ENCODED_LEN {
26778 panic!(
26779 "buffer is too small (need {} bytes, but got {})",
26780 Self::ENCODED_LEN,
26781 __tmp.remaining(),
26782 )
26783 }
26784 __tmp.put_u32_le(self.time_boot_ms);
26785 __tmp.put_i16_le(self.xacc);
26786 __tmp.put_i16_le(self.yacc);
26787 __tmp.put_i16_le(self.zacc);
26788 __tmp.put_i16_le(self.xgyro);
26789 __tmp.put_i16_le(self.ygyro);
26790 __tmp.put_i16_le(self.zgyro);
26791 __tmp.put_i16_le(self.xmag);
26792 __tmp.put_i16_le(self.ymag);
26793 __tmp.put_i16_le(self.zmag);
26794 if matches!(version, MavlinkVersion::V2) {
26795 __tmp.put_i16_le(self.temperature);
26796 let len = __tmp.len();
26797 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26798 } else {
26799 __tmp.len()
26800 }
26801 }
26802}
26803#[doc = "The RAW IMU readings for secondary 9DOF sensor setup. This message should contain the scaled values to the described units."]
26804#[doc = ""]
26805#[doc = "ID: 116"]
26806#[derive(Debug, Clone, PartialEq)]
26807#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26808#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26809#[cfg_attr(feature = "ts", derive(TS))]
26810#[cfg_attr(feature = "ts", ts(export))]
26811pub struct SCALED_IMU2_DATA {
26812 #[doc = "Timestamp (time since system boot)."]
26813 pub time_boot_ms: u32,
26814 #[doc = "X acceleration"]
26815 pub xacc: i16,
26816 #[doc = "Y acceleration"]
26817 pub yacc: i16,
26818 #[doc = "Z acceleration"]
26819 pub zacc: i16,
26820 #[doc = "Angular speed around X axis"]
26821 pub xgyro: i16,
26822 #[doc = "Angular speed around Y axis"]
26823 pub ygyro: i16,
26824 #[doc = "Angular speed around Z axis"]
26825 pub zgyro: i16,
26826 #[doc = "X Magnetic field"]
26827 pub xmag: i16,
26828 #[doc = "Y Magnetic field"]
26829 pub ymag: i16,
26830 #[doc = "Z Magnetic field"]
26831 pub zmag: i16,
26832 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
26833 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26834 pub temperature: i16,
26835}
26836impl SCALED_IMU2_DATA {
26837 pub const ENCODED_LEN: usize = 24usize;
26838 pub const DEFAULT: Self = Self {
26839 time_boot_ms: 0_u32,
26840 xacc: 0_i16,
26841 yacc: 0_i16,
26842 zacc: 0_i16,
26843 xgyro: 0_i16,
26844 ygyro: 0_i16,
26845 zgyro: 0_i16,
26846 xmag: 0_i16,
26847 ymag: 0_i16,
26848 zmag: 0_i16,
26849 temperature: 0_i16,
26850 };
26851 #[cfg(feature = "arbitrary")]
26852 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26853 use arbitrary::{Arbitrary, Unstructured};
26854 let mut buf = [0u8; 1024];
26855 rng.fill_bytes(&mut buf);
26856 let mut unstructured = Unstructured::new(&buf);
26857 Self::arbitrary(&mut unstructured).unwrap_or_default()
26858 }
26859}
26860impl Default for SCALED_IMU2_DATA {
26861 fn default() -> Self {
26862 Self::DEFAULT.clone()
26863 }
26864}
26865impl MessageData for SCALED_IMU2_DATA {
26866 type Message = MavMessage;
26867 const ID: u32 = 116u32;
26868 const NAME: &'static str = "SCALED_IMU2";
26869 const EXTRA_CRC: u8 = 76u8;
26870 const ENCODED_LEN: usize = 24usize;
26871 fn deser(
26872 _version: MavlinkVersion,
26873 __input: &[u8],
26874 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26875 let avail_len = __input.len();
26876 let mut payload_buf = [0; Self::ENCODED_LEN];
26877 let mut buf = if avail_len < Self::ENCODED_LEN {
26878 payload_buf[0..avail_len].copy_from_slice(__input);
26879 Bytes::new(&payload_buf)
26880 } else {
26881 Bytes::new(__input)
26882 };
26883 let mut __struct = Self::default();
26884 __struct.time_boot_ms = buf.get_u32_le();
26885 __struct.xacc = buf.get_i16_le();
26886 __struct.yacc = buf.get_i16_le();
26887 __struct.zacc = buf.get_i16_le();
26888 __struct.xgyro = buf.get_i16_le();
26889 __struct.ygyro = buf.get_i16_le();
26890 __struct.zgyro = buf.get_i16_le();
26891 __struct.xmag = buf.get_i16_le();
26892 __struct.ymag = buf.get_i16_le();
26893 __struct.zmag = buf.get_i16_le();
26894 __struct.temperature = buf.get_i16_le();
26895 Ok(__struct)
26896 }
26897 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26898 let mut __tmp = BytesMut::new(bytes);
26899 #[allow(clippy::absurd_extreme_comparisons)]
26900 #[allow(unused_comparisons)]
26901 if __tmp.remaining() < Self::ENCODED_LEN {
26902 panic!(
26903 "buffer is too small (need {} bytes, but got {})",
26904 Self::ENCODED_LEN,
26905 __tmp.remaining(),
26906 )
26907 }
26908 __tmp.put_u32_le(self.time_boot_ms);
26909 __tmp.put_i16_le(self.xacc);
26910 __tmp.put_i16_le(self.yacc);
26911 __tmp.put_i16_le(self.zacc);
26912 __tmp.put_i16_le(self.xgyro);
26913 __tmp.put_i16_le(self.ygyro);
26914 __tmp.put_i16_le(self.zgyro);
26915 __tmp.put_i16_le(self.xmag);
26916 __tmp.put_i16_le(self.ymag);
26917 __tmp.put_i16_le(self.zmag);
26918 if matches!(version, MavlinkVersion::V2) {
26919 __tmp.put_i16_le(self.temperature);
26920 let len = __tmp.len();
26921 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26922 } else {
26923 __tmp.len()
26924 }
26925 }
26926}
26927#[doc = "The RAW IMU readings for 3rd 9DOF sensor setup. This message should contain the scaled values to the described units."]
26928#[doc = ""]
26929#[doc = "ID: 129"]
26930#[derive(Debug, Clone, PartialEq)]
26931#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26932#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26933#[cfg_attr(feature = "ts", derive(TS))]
26934#[cfg_attr(feature = "ts", ts(export))]
26935pub struct SCALED_IMU3_DATA {
26936 #[doc = "Timestamp (time since system boot)."]
26937 pub time_boot_ms: u32,
26938 #[doc = "X acceleration"]
26939 pub xacc: i16,
26940 #[doc = "Y acceleration"]
26941 pub yacc: i16,
26942 #[doc = "Z acceleration"]
26943 pub zacc: i16,
26944 #[doc = "Angular speed around X axis"]
26945 pub xgyro: i16,
26946 #[doc = "Angular speed around Y axis"]
26947 pub ygyro: i16,
26948 #[doc = "Angular speed around Z axis"]
26949 pub zgyro: i16,
26950 #[doc = "X Magnetic field"]
26951 pub xmag: i16,
26952 #[doc = "Y Magnetic field"]
26953 pub ymag: i16,
26954 #[doc = "Z Magnetic field"]
26955 pub zmag: i16,
26956 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
26957 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26958 pub temperature: i16,
26959}
26960impl SCALED_IMU3_DATA {
26961 pub const ENCODED_LEN: usize = 24usize;
26962 pub const DEFAULT: Self = Self {
26963 time_boot_ms: 0_u32,
26964 xacc: 0_i16,
26965 yacc: 0_i16,
26966 zacc: 0_i16,
26967 xgyro: 0_i16,
26968 ygyro: 0_i16,
26969 zgyro: 0_i16,
26970 xmag: 0_i16,
26971 ymag: 0_i16,
26972 zmag: 0_i16,
26973 temperature: 0_i16,
26974 };
26975 #[cfg(feature = "arbitrary")]
26976 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26977 use arbitrary::{Arbitrary, Unstructured};
26978 let mut buf = [0u8; 1024];
26979 rng.fill_bytes(&mut buf);
26980 let mut unstructured = Unstructured::new(&buf);
26981 Self::arbitrary(&mut unstructured).unwrap_or_default()
26982 }
26983}
26984impl Default for SCALED_IMU3_DATA {
26985 fn default() -> Self {
26986 Self::DEFAULT.clone()
26987 }
26988}
26989impl MessageData for SCALED_IMU3_DATA {
26990 type Message = MavMessage;
26991 const ID: u32 = 129u32;
26992 const NAME: &'static str = "SCALED_IMU3";
26993 const EXTRA_CRC: u8 = 46u8;
26994 const ENCODED_LEN: usize = 24usize;
26995 fn deser(
26996 _version: MavlinkVersion,
26997 __input: &[u8],
26998 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26999 let avail_len = __input.len();
27000 let mut payload_buf = [0; Self::ENCODED_LEN];
27001 let mut buf = if avail_len < Self::ENCODED_LEN {
27002 payload_buf[0..avail_len].copy_from_slice(__input);
27003 Bytes::new(&payload_buf)
27004 } else {
27005 Bytes::new(__input)
27006 };
27007 let mut __struct = Self::default();
27008 __struct.time_boot_ms = buf.get_u32_le();
27009 __struct.xacc = buf.get_i16_le();
27010 __struct.yacc = buf.get_i16_le();
27011 __struct.zacc = buf.get_i16_le();
27012 __struct.xgyro = buf.get_i16_le();
27013 __struct.ygyro = buf.get_i16_le();
27014 __struct.zgyro = buf.get_i16_le();
27015 __struct.xmag = buf.get_i16_le();
27016 __struct.ymag = buf.get_i16_le();
27017 __struct.zmag = buf.get_i16_le();
27018 __struct.temperature = buf.get_i16_le();
27019 Ok(__struct)
27020 }
27021 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27022 let mut __tmp = BytesMut::new(bytes);
27023 #[allow(clippy::absurd_extreme_comparisons)]
27024 #[allow(unused_comparisons)]
27025 if __tmp.remaining() < Self::ENCODED_LEN {
27026 panic!(
27027 "buffer is too small (need {} bytes, but got {})",
27028 Self::ENCODED_LEN,
27029 __tmp.remaining(),
27030 )
27031 }
27032 __tmp.put_u32_le(self.time_boot_ms);
27033 __tmp.put_i16_le(self.xacc);
27034 __tmp.put_i16_le(self.yacc);
27035 __tmp.put_i16_le(self.zacc);
27036 __tmp.put_i16_le(self.xgyro);
27037 __tmp.put_i16_le(self.ygyro);
27038 __tmp.put_i16_le(self.zgyro);
27039 __tmp.put_i16_le(self.xmag);
27040 __tmp.put_i16_le(self.ymag);
27041 __tmp.put_i16_le(self.zmag);
27042 if matches!(version, MavlinkVersion::V2) {
27043 __tmp.put_i16_le(self.temperature);
27044 let len = __tmp.len();
27045 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27046 } else {
27047 __tmp.len()
27048 }
27049 }
27050}
27051#[doc = "The pressure readings for the typical setup of one absolute and differential pressure sensor. The units are as specified in each field."]
27052#[doc = ""]
27053#[doc = "ID: 29"]
27054#[derive(Debug, Clone, PartialEq)]
27055#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27056#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27057#[cfg_attr(feature = "ts", derive(TS))]
27058#[cfg_attr(feature = "ts", ts(export))]
27059pub struct SCALED_PRESSURE_DATA {
27060 #[doc = "Timestamp (time since system boot)."]
27061 pub time_boot_ms: u32,
27062 #[doc = "Absolute pressure"]
27063 pub press_abs: f32,
27064 #[doc = "Differential pressure 1"]
27065 pub press_diff: f32,
27066 #[doc = "Absolute pressure temperature"]
27067 pub temperature: i16,
27068 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
27069 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27070 pub temperature_press_diff: i16,
27071}
27072impl SCALED_PRESSURE_DATA {
27073 pub const ENCODED_LEN: usize = 16usize;
27074 pub const DEFAULT: Self = Self {
27075 time_boot_ms: 0_u32,
27076 press_abs: 0.0_f32,
27077 press_diff: 0.0_f32,
27078 temperature: 0_i16,
27079 temperature_press_diff: 0_i16,
27080 };
27081 #[cfg(feature = "arbitrary")]
27082 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27083 use arbitrary::{Arbitrary, Unstructured};
27084 let mut buf = [0u8; 1024];
27085 rng.fill_bytes(&mut buf);
27086 let mut unstructured = Unstructured::new(&buf);
27087 Self::arbitrary(&mut unstructured).unwrap_or_default()
27088 }
27089}
27090impl Default for SCALED_PRESSURE_DATA {
27091 fn default() -> Self {
27092 Self::DEFAULT.clone()
27093 }
27094}
27095impl MessageData for SCALED_PRESSURE_DATA {
27096 type Message = MavMessage;
27097 const ID: u32 = 29u32;
27098 const NAME: &'static str = "SCALED_PRESSURE";
27099 const EXTRA_CRC: u8 = 115u8;
27100 const ENCODED_LEN: usize = 16usize;
27101 fn deser(
27102 _version: MavlinkVersion,
27103 __input: &[u8],
27104 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27105 let avail_len = __input.len();
27106 let mut payload_buf = [0; Self::ENCODED_LEN];
27107 let mut buf = if avail_len < Self::ENCODED_LEN {
27108 payload_buf[0..avail_len].copy_from_slice(__input);
27109 Bytes::new(&payload_buf)
27110 } else {
27111 Bytes::new(__input)
27112 };
27113 let mut __struct = Self::default();
27114 __struct.time_boot_ms = buf.get_u32_le();
27115 __struct.press_abs = buf.get_f32_le();
27116 __struct.press_diff = buf.get_f32_le();
27117 __struct.temperature = buf.get_i16_le();
27118 __struct.temperature_press_diff = buf.get_i16_le();
27119 Ok(__struct)
27120 }
27121 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27122 let mut __tmp = BytesMut::new(bytes);
27123 #[allow(clippy::absurd_extreme_comparisons)]
27124 #[allow(unused_comparisons)]
27125 if __tmp.remaining() < Self::ENCODED_LEN {
27126 panic!(
27127 "buffer is too small (need {} bytes, but got {})",
27128 Self::ENCODED_LEN,
27129 __tmp.remaining(),
27130 )
27131 }
27132 __tmp.put_u32_le(self.time_boot_ms);
27133 __tmp.put_f32_le(self.press_abs);
27134 __tmp.put_f32_le(self.press_diff);
27135 __tmp.put_i16_le(self.temperature);
27136 if matches!(version, MavlinkVersion::V2) {
27137 __tmp.put_i16_le(self.temperature_press_diff);
27138 let len = __tmp.len();
27139 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27140 } else {
27141 __tmp.len()
27142 }
27143 }
27144}
27145#[doc = "Barometer readings for 2nd barometer."]
27146#[doc = ""]
27147#[doc = "ID: 137"]
27148#[derive(Debug, Clone, PartialEq)]
27149#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27150#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27151#[cfg_attr(feature = "ts", derive(TS))]
27152#[cfg_attr(feature = "ts", ts(export))]
27153pub struct SCALED_PRESSURE2_DATA {
27154 #[doc = "Timestamp (time since system boot)."]
27155 pub time_boot_ms: u32,
27156 #[doc = "Absolute pressure"]
27157 pub press_abs: f32,
27158 #[doc = "Differential pressure"]
27159 pub press_diff: f32,
27160 #[doc = "Absolute pressure temperature"]
27161 pub temperature: i16,
27162 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
27163 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27164 pub temperature_press_diff: i16,
27165}
27166impl SCALED_PRESSURE2_DATA {
27167 pub const ENCODED_LEN: usize = 16usize;
27168 pub const DEFAULT: Self = Self {
27169 time_boot_ms: 0_u32,
27170 press_abs: 0.0_f32,
27171 press_diff: 0.0_f32,
27172 temperature: 0_i16,
27173 temperature_press_diff: 0_i16,
27174 };
27175 #[cfg(feature = "arbitrary")]
27176 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27177 use arbitrary::{Arbitrary, Unstructured};
27178 let mut buf = [0u8; 1024];
27179 rng.fill_bytes(&mut buf);
27180 let mut unstructured = Unstructured::new(&buf);
27181 Self::arbitrary(&mut unstructured).unwrap_or_default()
27182 }
27183}
27184impl Default for SCALED_PRESSURE2_DATA {
27185 fn default() -> Self {
27186 Self::DEFAULT.clone()
27187 }
27188}
27189impl MessageData for SCALED_PRESSURE2_DATA {
27190 type Message = MavMessage;
27191 const ID: u32 = 137u32;
27192 const NAME: &'static str = "SCALED_PRESSURE2";
27193 const EXTRA_CRC: u8 = 195u8;
27194 const ENCODED_LEN: usize = 16usize;
27195 fn deser(
27196 _version: MavlinkVersion,
27197 __input: &[u8],
27198 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27199 let avail_len = __input.len();
27200 let mut payload_buf = [0; Self::ENCODED_LEN];
27201 let mut buf = if avail_len < Self::ENCODED_LEN {
27202 payload_buf[0..avail_len].copy_from_slice(__input);
27203 Bytes::new(&payload_buf)
27204 } else {
27205 Bytes::new(__input)
27206 };
27207 let mut __struct = Self::default();
27208 __struct.time_boot_ms = buf.get_u32_le();
27209 __struct.press_abs = buf.get_f32_le();
27210 __struct.press_diff = buf.get_f32_le();
27211 __struct.temperature = buf.get_i16_le();
27212 __struct.temperature_press_diff = buf.get_i16_le();
27213 Ok(__struct)
27214 }
27215 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27216 let mut __tmp = BytesMut::new(bytes);
27217 #[allow(clippy::absurd_extreme_comparisons)]
27218 #[allow(unused_comparisons)]
27219 if __tmp.remaining() < Self::ENCODED_LEN {
27220 panic!(
27221 "buffer is too small (need {} bytes, but got {})",
27222 Self::ENCODED_LEN,
27223 __tmp.remaining(),
27224 )
27225 }
27226 __tmp.put_u32_le(self.time_boot_ms);
27227 __tmp.put_f32_le(self.press_abs);
27228 __tmp.put_f32_le(self.press_diff);
27229 __tmp.put_i16_le(self.temperature);
27230 if matches!(version, MavlinkVersion::V2) {
27231 __tmp.put_i16_le(self.temperature_press_diff);
27232 let len = __tmp.len();
27233 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27234 } else {
27235 __tmp.len()
27236 }
27237 }
27238}
27239#[doc = "Barometer readings for 3rd barometer."]
27240#[doc = ""]
27241#[doc = "ID: 143"]
27242#[derive(Debug, Clone, PartialEq)]
27243#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27244#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27245#[cfg_attr(feature = "ts", derive(TS))]
27246#[cfg_attr(feature = "ts", ts(export))]
27247pub struct SCALED_PRESSURE3_DATA {
27248 #[doc = "Timestamp (time since system boot)."]
27249 pub time_boot_ms: u32,
27250 #[doc = "Absolute pressure"]
27251 pub press_abs: f32,
27252 #[doc = "Differential pressure"]
27253 pub press_diff: f32,
27254 #[doc = "Absolute pressure temperature"]
27255 pub temperature: i16,
27256 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
27257 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27258 pub temperature_press_diff: i16,
27259}
27260impl SCALED_PRESSURE3_DATA {
27261 pub const ENCODED_LEN: usize = 16usize;
27262 pub const DEFAULT: Self = Self {
27263 time_boot_ms: 0_u32,
27264 press_abs: 0.0_f32,
27265 press_diff: 0.0_f32,
27266 temperature: 0_i16,
27267 temperature_press_diff: 0_i16,
27268 };
27269 #[cfg(feature = "arbitrary")]
27270 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27271 use arbitrary::{Arbitrary, Unstructured};
27272 let mut buf = [0u8; 1024];
27273 rng.fill_bytes(&mut buf);
27274 let mut unstructured = Unstructured::new(&buf);
27275 Self::arbitrary(&mut unstructured).unwrap_or_default()
27276 }
27277}
27278impl Default for SCALED_PRESSURE3_DATA {
27279 fn default() -> Self {
27280 Self::DEFAULT.clone()
27281 }
27282}
27283impl MessageData for SCALED_PRESSURE3_DATA {
27284 type Message = MavMessage;
27285 const ID: u32 = 143u32;
27286 const NAME: &'static str = "SCALED_PRESSURE3";
27287 const EXTRA_CRC: u8 = 131u8;
27288 const ENCODED_LEN: usize = 16usize;
27289 fn deser(
27290 _version: MavlinkVersion,
27291 __input: &[u8],
27292 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27293 let avail_len = __input.len();
27294 let mut payload_buf = [0; Self::ENCODED_LEN];
27295 let mut buf = if avail_len < Self::ENCODED_LEN {
27296 payload_buf[0..avail_len].copy_from_slice(__input);
27297 Bytes::new(&payload_buf)
27298 } else {
27299 Bytes::new(__input)
27300 };
27301 let mut __struct = Self::default();
27302 __struct.time_boot_ms = buf.get_u32_le();
27303 __struct.press_abs = buf.get_f32_le();
27304 __struct.press_diff = buf.get_f32_le();
27305 __struct.temperature = buf.get_i16_le();
27306 __struct.temperature_press_diff = buf.get_i16_le();
27307 Ok(__struct)
27308 }
27309 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27310 let mut __tmp = BytesMut::new(bytes);
27311 #[allow(clippy::absurd_extreme_comparisons)]
27312 #[allow(unused_comparisons)]
27313 if __tmp.remaining() < Self::ENCODED_LEN {
27314 panic!(
27315 "buffer is too small (need {} bytes, but got {})",
27316 Self::ENCODED_LEN,
27317 __tmp.remaining(),
27318 )
27319 }
27320 __tmp.put_u32_le(self.time_boot_ms);
27321 __tmp.put_f32_le(self.press_abs);
27322 __tmp.put_f32_le(self.press_diff);
27323 __tmp.put_i16_le(self.temperature);
27324 if matches!(version, MavlinkVersion::V2) {
27325 __tmp.put_i16_le(self.temperature_press_diff);
27326 let len = __tmp.len();
27327 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27328 } else {
27329 __tmp.len()
27330 }
27331 }
27332}
27333#[doc = "Control a serial port. This can be used for raw access to an onboard serial peripheral such as a GPS or telemetry radio. It is designed to make it possible to update the devices firmware via MAVLink messages or change the devices settings. A message with zero bytes can be used to change just the baudrate."]
27334#[doc = ""]
27335#[doc = "ID: 126"]
27336#[derive(Debug, Clone, PartialEq)]
27337#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27338#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27339#[cfg_attr(feature = "ts", derive(TS))]
27340#[cfg_attr(feature = "ts", ts(export))]
27341pub struct SERIAL_CONTROL_DATA {
27342 #[doc = "Baudrate of transfer. Zero means no change."]
27343 pub baudrate: u32,
27344 #[doc = "Timeout for reply data"]
27345 pub timeout: u16,
27346 #[doc = "Serial control device type."]
27347 pub device: SerialControlDev,
27348 #[doc = "Bitmap of serial control flags."]
27349 pub flags: SerialControlFlag,
27350 #[doc = "how many bytes in this transfer"]
27351 pub count: u8,
27352 #[doc = "serial data"]
27353 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27354 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
27355 pub data: [u8; 70],
27356 #[doc = "System ID"]
27357 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27358 pub target_system: u8,
27359 #[doc = "Component ID"]
27360 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27361 pub target_component: u8,
27362}
27363impl SERIAL_CONTROL_DATA {
27364 pub const ENCODED_LEN: usize = 81usize;
27365 pub const DEFAULT: Self = Self {
27366 baudrate: 0_u32,
27367 timeout: 0_u16,
27368 device: SerialControlDev::DEFAULT,
27369 flags: SerialControlFlag::DEFAULT,
27370 count: 0_u8,
27371 data: [0_u8; 70usize],
27372 target_system: 0_u8,
27373 target_component: 0_u8,
27374 };
27375 #[cfg(feature = "arbitrary")]
27376 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27377 use arbitrary::{Arbitrary, Unstructured};
27378 let mut buf = [0u8; 1024];
27379 rng.fill_bytes(&mut buf);
27380 let mut unstructured = Unstructured::new(&buf);
27381 Self::arbitrary(&mut unstructured).unwrap_or_default()
27382 }
27383}
27384impl Default for SERIAL_CONTROL_DATA {
27385 fn default() -> Self {
27386 Self::DEFAULT.clone()
27387 }
27388}
27389impl MessageData for SERIAL_CONTROL_DATA {
27390 type Message = MavMessage;
27391 const ID: u32 = 126u32;
27392 const NAME: &'static str = "SERIAL_CONTROL";
27393 const EXTRA_CRC: u8 = 220u8;
27394 const ENCODED_LEN: usize = 81usize;
27395 fn deser(
27396 _version: MavlinkVersion,
27397 __input: &[u8],
27398 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27399 let avail_len = __input.len();
27400 let mut payload_buf = [0; Self::ENCODED_LEN];
27401 let mut buf = if avail_len < Self::ENCODED_LEN {
27402 payload_buf[0..avail_len].copy_from_slice(__input);
27403 Bytes::new(&payload_buf)
27404 } else {
27405 Bytes::new(__input)
27406 };
27407 let mut __struct = Self::default();
27408 __struct.baudrate = buf.get_u32_le();
27409 __struct.timeout = buf.get_u16_le();
27410 let tmp = buf.get_u8();
27411 __struct.device =
27412 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27413 enum_type: "SerialControlDev",
27414 value: tmp as u64,
27415 })?;
27416 let tmp = buf.get_u8();
27417 __struct.flags = SerialControlFlag::from_bits(tmp).ok_or(
27418 ::mavlink_core::error::ParserError::InvalidFlag {
27419 flag_type: "SerialControlFlag",
27420 value: tmp as u64,
27421 },
27422 )?;
27423 __struct.count = buf.get_u8();
27424 for v in &mut __struct.data {
27425 let val = buf.get_u8();
27426 *v = val;
27427 }
27428 __struct.target_system = buf.get_u8();
27429 __struct.target_component = buf.get_u8();
27430 Ok(__struct)
27431 }
27432 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27433 let mut __tmp = BytesMut::new(bytes);
27434 #[allow(clippy::absurd_extreme_comparisons)]
27435 #[allow(unused_comparisons)]
27436 if __tmp.remaining() < Self::ENCODED_LEN {
27437 panic!(
27438 "buffer is too small (need {} bytes, but got {})",
27439 Self::ENCODED_LEN,
27440 __tmp.remaining(),
27441 )
27442 }
27443 __tmp.put_u32_le(self.baudrate);
27444 __tmp.put_u16_le(self.timeout);
27445 __tmp.put_u8(self.device as u8);
27446 __tmp.put_u8(self.flags.bits());
27447 __tmp.put_u8(self.count);
27448 for val in &self.data {
27449 __tmp.put_u8(*val);
27450 }
27451 if matches!(version, MavlinkVersion::V2) {
27452 __tmp.put_u8(self.target_system);
27453 __tmp.put_u8(self.target_component);
27454 let len = __tmp.len();
27455 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27456 } else {
27457 __tmp.len()
27458 }
27459 }
27460}
27461#[doc = "Superseded by ACTUATOR_OUTPUT_STATUS. The RAW values of the servo outputs (for RC input from the remote, use the RC_CHANNELS messages). The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%."]
27462#[doc = ""]
27463#[doc = "ID: 36"]
27464#[derive(Debug, Clone, PartialEq)]
27465#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27466#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27467#[cfg_attr(feature = "ts", derive(TS))]
27468#[cfg_attr(feature = "ts", ts(export))]
27469pub struct SERVO_OUTPUT_RAW_DATA {
27470 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
27471 pub time_usec: u32,
27472 #[doc = "Servo output 1 value"]
27473 pub servo1_raw: u16,
27474 #[doc = "Servo output 2 value"]
27475 pub servo2_raw: u16,
27476 #[doc = "Servo output 3 value"]
27477 pub servo3_raw: u16,
27478 #[doc = "Servo output 4 value"]
27479 pub servo4_raw: u16,
27480 #[doc = "Servo output 5 value"]
27481 pub servo5_raw: u16,
27482 #[doc = "Servo output 6 value"]
27483 pub servo6_raw: u16,
27484 #[doc = "Servo output 7 value"]
27485 pub servo7_raw: u16,
27486 #[doc = "Servo output 8 value"]
27487 pub servo8_raw: u16,
27488 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
27489 pub port: u8,
27490 #[doc = "Servo output 9 value"]
27491 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27492 pub servo9_raw: u16,
27493 #[doc = "Servo output 10 value"]
27494 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27495 pub servo10_raw: u16,
27496 #[doc = "Servo output 11 value"]
27497 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27498 pub servo11_raw: u16,
27499 #[doc = "Servo output 12 value"]
27500 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27501 pub servo12_raw: u16,
27502 #[doc = "Servo output 13 value"]
27503 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27504 pub servo13_raw: u16,
27505 #[doc = "Servo output 14 value"]
27506 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27507 pub servo14_raw: u16,
27508 #[doc = "Servo output 15 value"]
27509 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27510 pub servo15_raw: u16,
27511 #[doc = "Servo output 16 value"]
27512 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27513 pub servo16_raw: u16,
27514}
27515impl SERVO_OUTPUT_RAW_DATA {
27516 pub const ENCODED_LEN: usize = 37usize;
27517 pub const DEFAULT: Self = Self {
27518 time_usec: 0_u32,
27519 servo1_raw: 0_u16,
27520 servo2_raw: 0_u16,
27521 servo3_raw: 0_u16,
27522 servo4_raw: 0_u16,
27523 servo5_raw: 0_u16,
27524 servo6_raw: 0_u16,
27525 servo7_raw: 0_u16,
27526 servo8_raw: 0_u16,
27527 port: 0_u8,
27528 servo9_raw: 0_u16,
27529 servo10_raw: 0_u16,
27530 servo11_raw: 0_u16,
27531 servo12_raw: 0_u16,
27532 servo13_raw: 0_u16,
27533 servo14_raw: 0_u16,
27534 servo15_raw: 0_u16,
27535 servo16_raw: 0_u16,
27536 };
27537 #[cfg(feature = "arbitrary")]
27538 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27539 use arbitrary::{Arbitrary, Unstructured};
27540 let mut buf = [0u8; 1024];
27541 rng.fill_bytes(&mut buf);
27542 let mut unstructured = Unstructured::new(&buf);
27543 Self::arbitrary(&mut unstructured).unwrap_or_default()
27544 }
27545}
27546impl Default for SERVO_OUTPUT_RAW_DATA {
27547 fn default() -> Self {
27548 Self::DEFAULT.clone()
27549 }
27550}
27551impl MessageData for SERVO_OUTPUT_RAW_DATA {
27552 type Message = MavMessage;
27553 const ID: u32 = 36u32;
27554 const NAME: &'static str = "SERVO_OUTPUT_RAW";
27555 const EXTRA_CRC: u8 = 222u8;
27556 const ENCODED_LEN: usize = 37usize;
27557 fn deser(
27558 _version: MavlinkVersion,
27559 __input: &[u8],
27560 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27561 let avail_len = __input.len();
27562 let mut payload_buf = [0; Self::ENCODED_LEN];
27563 let mut buf = if avail_len < Self::ENCODED_LEN {
27564 payload_buf[0..avail_len].copy_from_slice(__input);
27565 Bytes::new(&payload_buf)
27566 } else {
27567 Bytes::new(__input)
27568 };
27569 let mut __struct = Self::default();
27570 __struct.time_usec = buf.get_u32_le();
27571 __struct.servo1_raw = buf.get_u16_le();
27572 __struct.servo2_raw = buf.get_u16_le();
27573 __struct.servo3_raw = buf.get_u16_le();
27574 __struct.servo4_raw = buf.get_u16_le();
27575 __struct.servo5_raw = buf.get_u16_le();
27576 __struct.servo6_raw = buf.get_u16_le();
27577 __struct.servo7_raw = buf.get_u16_le();
27578 __struct.servo8_raw = buf.get_u16_le();
27579 __struct.port = buf.get_u8();
27580 __struct.servo9_raw = buf.get_u16_le();
27581 __struct.servo10_raw = buf.get_u16_le();
27582 __struct.servo11_raw = buf.get_u16_le();
27583 __struct.servo12_raw = buf.get_u16_le();
27584 __struct.servo13_raw = buf.get_u16_le();
27585 __struct.servo14_raw = buf.get_u16_le();
27586 __struct.servo15_raw = buf.get_u16_le();
27587 __struct.servo16_raw = buf.get_u16_le();
27588 Ok(__struct)
27589 }
27590 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27591 let mut __tmp = BytesMut::new(bytes);
27592 #[allow(clippy::absurd_extreme_comparisons)]
27593 #[allow(unused_comparisons)]
27594 if __tmp.remaining() < Self::ENCODED_LEN {
27595 panic!(
27596 "buffer is too small (need {} bytes, but got {})",
27597 Self::ENCODED_LEN,
27598 __tmp.remaining(),
27599 )
27600 }
27601 __tmp.put_u32_le(self.time_usec);
27602 __tmp.put_u16_le(self.servo1_raw);
27603 __tmp.put_u16_le(self.servo2_raw);
27604 __tmp.put_u16_le(self.servo3_raw);
27605 __tmp.put_u16_le(self.servo4_raw);
27606 __tmp.put_u16_le(self.servo5_raw);
27607 __tmp.put_u16_le(self.servo6_raw);
27608 __tmp.put_u16_le(self.servo7_raw);
27609 __tmp.put_u16_le(self.servo8_raw);
27610 __tmp.put_u8(self.port);
27611 if matches!(version, MavlinkVersion::V2) {
27612 __tmp.put_u16_le(self.servo9_raw);
27613 __tmp.put_u16_le(self.servo10_raw);
27614 __tmp.put_u16_le(self.servo11_raw);
27615 __tmp.put_u16_le(self.servo12_raw);
27616 __tmp.put_u16_le(self.servo13_raw);
27617 __tmp.put_u16_le(self.servo14_raw);
27618 __tmp.put_u16_le(self.servo15_raw);
27619 __tmp.put_u16_le(self.servo16_raw);
27620 let len = __tmp.len();
27621 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27622 } else {
27623 __tmp.len()
27624 }
27625 }
27626}
27627#[doc = "Setup a MAVLink2 signing key. If called with secret_key of all zero and zero initial_timestamp will disable signing."]
27628#[doc = ""]
27629#[doc = "ID: 256"]
27630#[derive(Debug, Clone, PartialEq)]
27631#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27632#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27633#[cfg_attr(feature = "ts", derive(TS))]
27634#[cfg_attr(feature = "ts", ts(export))]
27635pub struct SETUP_SIGNING_DATA {
27636 #[doc = "initial timestamp"]
27637 pub initial_timestamp: u64,
27638 #[doc = "system id of the target"]
27639 pub target_system: u8,
27640 #[doc = "component ID of the target"]
27641 pub target_component: u8,
27642 #[doc = "signing key"]
27643 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27644 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
27645 pub secret_key: [u8; 32],
27646}
27647impl SETUP_SIGNING_DATA {
27648 pub const ENCODED_LEN: usize = 42usize;
27649 pub const DEFAULT: Self = Self {
27650 initial_timestamp: 0_u64,
27651 target_system: 0_u8,
27652 target_component: 0_u8,
27653 secret_key: [0_u8; 32usize],
27654 };
27655 #[cfg(feature = "arbitrary")]
27656 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27657 use arbitrary::{Arbitrary, Unstructured};
27658 let mut buf = [0u8; 1024];
27659 rng.fill_bytes(&mut buf);
27660 let mut unstructured = Unstructured::new(&buf);
27661 Self::arbitrary(&mut unstructured).unwrap_or_default()
27662 }
27663}
27664impl Default for SETUP_SIGNING_DATA {
27665 fn default() -> Self {
27666 Self::DEFAULT.clone()
27667 }
27668}
27669impl MessageData for SETUP_SIGNING_DATA {
27670 type Message = MavMessage;
27671 const ID: u32 = 256u32;
27672 const NAME: &'static str = "SETUP_SIGNING";
27673 const EXTRA_CRC: u8 = 71u8;
27674 const ENCODED_LEN: usize = 42usize;
27675 fn deser(
27676 _version: MavlinkVersion,
27677 __input: &[u8],
27678 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27679 let avail_len = __input.len();
27680 let mut payload_buf = [0; Self::ENCODED_LEN];
27681 let mut buf = if avail_len < Self::ENCODED_LEN {
27682 payload_buf[0..avail_len].copy_from_slice(__input);
27683 Bytes::new(&payload_buf)
27684 } else {
27685 Bytes::new(__input)
27686 };
27687 let mut __struct = Self::default();
27688 __struct.initial_timestamp = buf.get_u64_le();
27689 __struct.target_system = buf.get_u8();
27690 __struct.target_component = buf.get_u8();
27691 for v in &mut __struct.secret_key {
27692 let val = buf.get_u8();
27693 *v = val;
27694 }
27695 Ok(__struct)
27696 }
27697 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27698 let mut __tmp = BytesMut::new(bytes);
27699 #[allow(clippy::absurd_extreme_comparisons)]
27700 #[allow(unused_comparisons)]
27701 if __tmp.remaining() < Self::ENCODED_LEN {
27702 panic!(
27703 "buffer is too small (need {} bytes, but got {})",
27704 Self::ENCODED_LEN,
27705 __tmp.remaining(),
27706 )
27707 }
27708 __tmp.put_u64_le(self.initial_timestamp);
27709 __tmp.put_u8(self.target_system);
27710 __tmp.put_u8(self.target_component);
27711 for val in &self.secret_key {
27712 __tmp.put_u8(*val);
27713 }
27714 if matches!(version, MavlinkVersion::V2) {
27715 let len = __tmp.len();
27716 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27717 } else {
27718 __tmp.len()
27719 }
27720 }
27721}
27722#[doc = "Set the vehicle attitude and body angular rates."]
27723#[doc = ""]
27724#[doc = "ID: 139"]
27725#[derive(Debug, Clone, PartialEq)]
27726#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27727#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27728#[cfg_attr(feature = "ts", derive(TS))]
27729#[cfg_attr(feature = "ts", ts(export))]
27730pub struct SET_ACTUATOR_CONTROL_TARGET_DATA {
27731 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
27732 pub time_usec: u64,
27733 #[doc = "Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs."]
27734 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27735 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
27736 pub controls: [f32; 8],
27737 #[doc = "Actuator group. The \"_mlx\" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances."]
27738 pub group_mlx: u8,
27739 #[doc = "System ID"]
27740 pub target_system: u8,
27741 #[doc = "Component ID"]
27742 pub target_component: u8,
27743}
27744impl SET_ACTUATOR_CONTROL_TARGET_DATA {
27745 pub const ENCODED_LEN: usize = 43usize;
27746 pub const DEFAULT: Self = Self {
27747 time_usec: 0_u64,
27748 controls: [0.0_f32; 8usize],
27749 group_mlx: 0_u8,
27750 target_system: 0_u8,
27751 target_component: 0_u8,
27752 };
27753 #[cfg(feature = "arbitrary")]
27754 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27755 use arbitrary::{Arbitrary, Unstructured};
27756 let mut buf = [0u8; 1024];
27757 rng.fill_bytes(&mut buf);
27758 let mut unstructured = Unstructured::new(&buf);
27759 Self::arbitrary(&mut unstructured).unwrap_or_default()
27760 }
27761}
27762impl Default for SET_ACTUATOR_CONTROL_TARGET_DATA {
27763 fn default() -> Self {
27764 Self::DEFAULT.clone()
27765 }
27766}
27767impl MessageData for SET_ACTUATOR_CONTROL_TARGET_DATA {
27768 type Message = MavMessage;
27769 const ID: u32 = 139u32;
27770 const NAME: &'static str = "SET_ACTUATOR_CONTROL_TARGET";
27771 const EXTRA_CRC: u8 = 168u8;
27772 const ENCODED_LEN: usize = 43usize;
27773 fn deser(
27774 _version: MavlinkVersion,
27775 __input: &[u8],
27776 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27777 let avail_len = __input.len();
27778 let mut payload_buf = [0; Self::ENCODED_LEN];
27779 let mut buf = if avail_len < Self::ENCODED_LEN {
27780 payload_buf[0..avail_len].copy_from_slice(__input);
27781 Bytes::new(&payload_buf)
27782 } else {
27783 Bytes::new(__input)
27784 };
27785 let mut __struct = Self::default();
27786 __struct.time_usec = buf.get_u64_le();
27787 for v in &mut __struct.controls {
27788 let val = buf.get_f32_le();
27789 *v = val;
27790 }
27791 __struct.group_mlx = buf.get_u8();
27792 __struct.target_system = buf.get_u8();
27793 __struct.target_component = buf.get_u8();
27794 Ok(__struct)
27795 }
27796 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27797 let mut __tmp = BytesMut::new(bytes);
27798 #[allow(clippy::absurd_extreme_comparisons)]
27799 #[allow(unused_comparisons)]
27800 if __tmp.remaining() < Self::ENCODED_LEN {
27801 panic!(
27802 "buffer is too small (need {} bytes, but got {})",
27803 Self::ENCODED_LEN,
27804 __tmp.remaining(),
27805 )
27806 }
27807 __tmp.put_u64_le(self.time_usec);
27808 for val in &self.controls {
27809 __tmp.put_f32_le(*val);
27810 }
27811 __tmp.put_u8(self.group_mlx);
27812 __tmp.put_u8(self.target_system);
27813 __tmp.put_u8(self.target_component);
27814 if matches!(version, MavlinkVersion::V2) {
27815 let len = __tmp.len();
27816 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27817 } else {
27818 __tmp.len()
27819 }
27820 }
27821}
27822#[doc = "Sets a desired vehicle attitude. Used by an external controller to command the vehicle (manual controller or other system)."]
27823#[doc = ""]
27824#[doc = "ID: 82"]
27825#[derive(Debug, Clone, PartialEq)]
27826#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27827#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27828#[cfg_attr(feature = "ts", derive(TS))]
27829#[cfg_attr(feature = "ts", ts(export))]
27830pub struct SET_ATTITUDE_TARGET_DATA {
27831 #[doc = "Timestamp (time since system boot)."]
27832 pub time_boot_ms: u32,
27833 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) from MAV_FRAME_LOCAL_NED to MAV_FRAME_BODY_FRD"]
27834 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27835 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
27836 pub q: [f32; 4],
27837 #[doc = "Body roll rate"]
27838 pub body_roll_rate: f32,
27839 #[doc = "Body pitch rate"]
27840 pub body_pitch_rate: f32,
27841 #[doc = "Body yaw rate"]
27842 pub body_yaw_rate: f32,
27843 #[doc = "Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)"]
27844 pub thrust: f32,
27845 #[doc = "System ID"]
27846 pub target_system: u8,
27847 #[doc = "Component ID"]
27848 pub target_component: u8,
27849 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
27850 pub type_mask: AttitudeTargetTypemask,
27851 #[doc = "3D thrust setpoint in the body NED frame, normalized to -1 .. 1"]
27852 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27853 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27854 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
27855 pub thrust_body: [f32; 3],
27856}
27857impl SET_ATTITUDE_TARGET_DATA {
27858 pub const ENCODED_LEN: usize = 51usize;
27859 pub const DEFAULT: Self = Self {
27860 time_boot_ms: 0_u32,
27861 q: [0.0_f32; 4usize],
27862 body_roll_rate: 0.0_f32,
27863 body_pitch_rate: 0.0_f32,
27864 body_yaw_rate: 0.0_f32,
27865 thrust: 0.0_f32,
27866 target_system: 0_u8,
27867 target_component: 0_u8,
27868 type_mask: AttitudeTargetTypemask::DEFAULT,
27869 thrust_body: [0.0_f32; 3usize],
27870 };
27871 #[cfg(feature = "arbitrary")]
27872 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27873 use arbitrary::{Arbitrary, Unstructured};
27874 let mut buf = [0u8; 1024];
27875 rng.fill_bytes(&mut buf);
27876 let mut unstructured = Unstructured::new(&buf);
27877 Self::arbitrary(&mut unstructured).unwrap_or_default()
27878 }
27879}
27880impl Default for SET_ATTITUDE_TARGET_DATA {
27881 fn default() -> Self {
27882 Self::DEFAULT.clone()
27883 }
27884}
27885impl MessageData for SET_ATTITUDE_TARGET_DATA {
27886 type Message = MavMessage;
27887 const ID: u32 = 82u32;
27888 const NAME: &'static str = "SET_ATTITUDE_TARGET";
27889 const EXTRA_CRC: u8 = 49u8;
27890 const ENCODED_LEN: usize = 51usize;
27891 fn deser(
27892 _version: MavlinkVersion,
27893 __input: &[u8],
27894 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27895 let avail_len = __input.len();
27896 let mut payload_buf = [0; Self::ENCODED_LEN];
27897 let mut buf = if avail_len < Self::ENCODED_LEN {
27898 payload_buf[0..avail_len].copy_from_slice(__input);
27899 Bytes::new(&payload_buf)
27900 } else {
27901 Bytes::new(__input)
27902 };
27903 let mut __struct = Self::default();
27904 __struct.time_boot_ms = buf.get_u32_le();
27905 for v in &mut __struct.q {
27906 let val = buf.get_f32_le();
27907 *v = val;
27908 }
27909 __struct.body_roll_rate = buf.get_f32_le();
27910 __struct.body_pitch_rate = buf.get_f32_le();
27911 __struct.body_yaw_rate = buf.get_f32_le();
27912 __struct.thrust = buf.get_f32_le();
27913 __struct.target_system = buf.get_u8();
27914 __struct.target_component = buf.get_u8();
27915 let tmp = buf.get_u8();
27916 __struct.type_mask = AttitudeTargetTypemask::from_bits(tmp).ok_or(
27917 ::mavlink_core::error::ParserError::InvalidFlag {
27918 flag_type: "AttitudeTargetTypemask",
27919 value: tmp as u64,
27920 },
27921 )?;
27922 for v in &mut __struct.thrust_body {
27923 let val = buf.get_f32_le();
27924 *v = val;
27925 }
27926 Ok(__struct)
27927 }
27928 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27929 let mut __tmp = BytesMut::new(bytes);
27930 #[allow(clippy::absurd_extreme_comparisons)]
27931 #[allow(unused_comparisons)]
27932 if __tmp.remaining() < Self::ENCODED_LEN {
27933 panic!(
27934 "buffer is too small (need {} bytes, but got {})",
27935 Self::ENCODED_LEN,
27936 __tmp.remaining(),
27937 )
27938 }
27939 __tmp.put_u32_le(self.time_boot_ms);
27940 for val in &self.q {
27941 __tmp.put_f32_le(*val);
27942 }
27943 __tmp.put_f32_le(self.body_roll_rate);
27944 __tmp.put_f32_le(self.body_pitch_rate);
27945 __tmp.put_f32_le(self.body_yaw_rate);
27946 __tmp.put_f32_le(self.thrust);
27947 __tmp.put_u8(self.target_system);
27948 __tmp.put_u8(self.target_component);
27949 __tmp.put_u8(self.type_mask.bits());
27950 if matches!(version, MavlinkVersion::V2) {
27951 for val in &self.thrust_body {
27952 __tmp.put_f32_le(*val);
27953 }
27954 let len = __tmp.len();
27955 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27956 } else {
27957 __tmp.len()
27958 }
27959 }
27960}
27961#[deprecated = " See `MAV_CMD_SET_GLOBAL_ORIGIN` (Deprecated since 2025-04)"]
27962#[doc = "Sets the GPS coordinates of the vehicle local origin (0,0,0) position. Vehicle should emit GPS_GLOBAL_ORIGIN irrespective of whether the origin is changed. This enables transform between the local coordinate frame and the global (GPS) coordinate frame, which may be necessary when (for example) indoor and outdoor settings are connected and the MAV should move from in- to outdoor."]
27963#[doc = ""]
27964#[doc = "ID: 48"]
27965#[derive(Debug, Clone, PartialEq)]
27966#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27967#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27968#[cfg_attr(feature = "ts", derive(TS))]
27969#[cfg_attr(feature = "ts", ts(export))]
27970pub struct SET_GPS_GLOBAL_ORIGIN_DATA {
27971 #[doc = "Latitude (WGS84)"]
27972 pub latitude: i32,
27973 #[doc = "Longitude (WGS84)"]
27974 pub longitude: i32,
27975 #[doc = "Altitude (MSL). Positive for up."]
27976 pub altitude: i32,
27977 #[doc = "System ID"]
27978 pub target_system: u8,
27979 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
27980 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27981 pub time_usec: u64,
27982}
27983impl SET_GPS_GLOBAL_ORIGIN_DATA {
27984 pub const ENCODED_LEN: usize = 21usize;
27985 pub const DEFAULT: Self = Self {
27986 latitude: 0_i32,
27987 longitude: 0_i32,
27988 altitude: 0_i32,
27989 target_system: 0_u8,
27990 time_usec: 0_u64,
27991 };
27992 #[cfg(feature = "arbitrary")]
27993 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27994 use arbitrary::{Arbitrary, Unstructured};
27995 let mut buf = [0u8; 1024];
27996 rng.fill_bytes(&mut buf);
27997 let mut unstructured = Unstructured::new(&buf);
27998 Self::arbitrary(&mut unstructured).unwrap_or_default()
27999 }
28000}
28001impl Default for SET_GPS_GLOBAL_ORIGIN_DATA {
28002 fn default() -> Self {
28003 Self::DEFAULT.clone()
28004 }
28005}
28006impl MessageData for SET_GPS_GLOBAL_ORIGIN_DATA {
28007 type Message = MavMessage;
28008 const ID: u32 = 48u32;
28009 const NAME: &'static str = "SET_GPS_GLOBAL_ORIGIN";
28010 const EXTRA_CRC: u8 = 41u8;
28011 const ENCODED_LEN: usize = 21usize;
28012 fn deser(
28013 _version: MavlinkVersion,
28014 __input: &[u8],
28015 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28016 let avail_len = __input.len();
28017 let mut payload_buf = [0; Self::ENCODED_LEN];
28018 let mut buf = if avail_len < Self::ENCODED_LEN {
28019 payload_buf[0..avail_len].copy_from_slice(__input);
28020 Bytes::new(&payload_buf)
28021 } else {
28022 Bytes::new(__input)
28023 };
28024 let mut __struct = Self::default();
28025 __struct.latitude = buf.get_i32_le();
28026 __struct.longitude = buf.get_i32_le();
28027 __struct.altitude = buf.get_i32_le();
28028 __struct.target_system = buf.get_u8();
28029 __struct.time_usec = buf.get_u64_le();
28030 Ok(__struct)
28031 }
28032 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28033 let mut __tmp = BytesMut::new(bytes);
28034 #[allow(clippy::absurd_extreme_comparisons)]
28035 #[allow(unused_comparisons)]
28036 if __tmp.remaining() < Self::ENCODED_LEN {
28037 panic!(
28038 "buffer is too small (need {} bytes, but got {})",
28039 Self::ENCODED_LEN,
28040 __tmp.remaining(),
28041 )
28042 }
28043 __tmp.put_i32_le(self.latitude);
28044 __tmp.put_i32_le(self.longitude);
28045 __tmp.put_i32_le(self.altitude);
28046 __tmp.put_u8(self.target_system);
28047 if matches!(version, MavlinkVersion::V2) {
28048 __tmp.put_u64_le(self.time_usec);
28049 let len = __tmp.len();
28050 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28051 } else {
28052 __tmp.len()
28053 }
28054 }
28055}
28056#[deprecated = "The command protocol version (MAV_CMD_DO_SET_HOME) allows a GCS to detect when setting the home position has failed. See `MAV_CMD_DO_SET_HOME` (Deprecated since 2022-02)"]
28057#[doc = "Sets the home position. \tThe home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this message). The global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. Under normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. The approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
28058#[doc = ""]
28059#[doc = "ID: 243"]
28060#[derive(Debug, Clone, PartialEq)]
28061#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28062#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28063#[cfg_attr(feature = "ts", derive(TS))]
28064#[cfg_attr(feature = "ts", ts(export))]
28065pub struct SET_HOME_POSITION_DATA {
28066 #[doc = "Latitude (WGS84)"]
28067 pub latitude: i32,
28068 #[doc = "Longitude (WGS84)"]
28069 pub longitude: i32,
28070 #[doc = "Altitude (MSL). Positive for up."]
28071 pub altitude: i32,
28072 #[doc = "Local X position of this position in the local coordinate frame (NED)"]
28073 pub x: f32,
28074 #[doc = "Local Y position of this position in the local coordinate frame (NED)"]
28075 pub y: f32,
28076 #[doc = "Local Z position of this position in the local coordinate frame (NED: positive \"down\")"]
28077 pub z: f32,
28078 #[doc = "World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground"]
28079 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28080 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
28081 pub q: [f32; 4],
28082 #[doc = "Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
28083 pub approach_x: f32,
28084 #[doc = "Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
28085 pub approach_y: f32,
28086 #[doc = "Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
28087 pub approach_z: f32,
28088 #[doc = "System ID."]
28089 pub target_system: u8,
28090 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
28091 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28092 pub time_usec: u64,
28093}
28094impl SET_HOME_POSITION_DATA {
28095 pub const ENCODED_LEN: usize = 61usize;
28096 pub const DEFAULT: Self = Self {
28097 latitude: 0_i32,
28098 longitude: 0_i32,
28099 altitude: 0_i32,
28100 x: 0.0_f32,
28101 y: 0.0_f32,
28102 z: 0.0_f32,
28103 q: [0.0_f32; 4usize],
28104 approach_x: 0.0_f32,
28105 approach_y: 0.0_f32,
28106 approach_z: 0.0_f32,
28107 target_system: 0_u8,
28108 time_usec: 0_u64,
28109 };
28110 #[cfg(feature = "arbitrary")]
28111 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28112 use arbitrary::{Arbitrary, Unstructured};
28113 let mut buf = [0u8; 1024];
28114 rng.fill_bytes(&mut buf);
28115 let mut unstructured = Unstructured::new(&buf);
28116 Self::arbitrary(&mut unstructured).unwrap_or_default()
28117 }
28118}
28119impl Default for SET_HOME_POSITION_DATA {
28120 fn default() -> Self {
28121 Self::DEFAULT.clone()
28122 }
28123}
28124impl MessageData for SET_HOME_POSITION_DATA {
28125 type Message = MavMessage;
28126 const ID: u32 = 243u32;
28127 const NAME: &'static str = "SET_HOME_POSITION";
28128 const EXTRA_CRC: u8 = 85u8;
28129 const ENCODED_LEN: usize = 61usize;
28130 fn deser(
28131 _version: MavlinkVersion,
28132 __input: &[u8],
28133 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28134 let avail_len = __input.len();
28135 let mut payload_buf = [0; Self::ENCODED_LEN];
28136 let mut buf = if avail_len < Self::ENCODED_LEN {
28137 payload_buf[0..avail_len].copy_from_slice(__input);
28138 Bytes::new(&payload_buf)
28139 } else {
28140 Bytes::new(__input)
28141 };
28142 let mut __struct = Self::default();
28143 __struct.latitude = buf.get_i32_le();
28144 __struct.longitude = buf.get_i32_le();
28145 __struct.altitude = buf.get_i32_le();
28146 __struct.x = buf.get_f32_le();
28147 __struct.y = buf.get_f32_le();
28148 __struct.z = buf.get_f32_le();
28149 for v in &mut __struct.q {
28150 let val = buf.get_f32_le();
28151 *v = val;
28152 }
28153 __struct.approach_x = buf.get_f32_le();
28154 __struct.approach_y = buf.get_f32_le();
28155 __struct.approach_z = buf.get_f32_le();
28156 __struct.target_system = buf.get_u8();
28157 __struct.time_usec = buf.get_u64_le();
28158 Ok(__struct)
28159 }
28160 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28161 let mut __tmp = BytesMut::new(bytes);
28162 #[allow(clippy::absurd_extreme_comparisons)]
28163 #[allow(unused_comparisons)]
28164 if __tmp.remaining() < Self::ENCODED_LEN {
28165 panic!(
28166 "buffer is too small (need {} bytes, but got {})",
28167 Self::ENCODED_LEN,
28168 __tmp.remaining(),
28169 )
28170 }
28171 __tmp.put_i32_le(self.latitude);
28172 __tmp.put_i32_le(self.longitude);
28173 __tmp.put_i32_le(self.altitude);
28174 __tmp.put_f32_le(self.x);
28175 __tmp.put_f32_le(self.y);
28176 __tmp.put_f32_le(self.z);
28177 for val in &self.q {
28178 __tmp.put_f32_le(*val);
28179 }
28180 __tmp.put_f32_le(self.approach_x);
28181 __tmp.put_f32_le(self.approach_y);
28182 __tmp.put_f32_le(self.approach_z);
28183 __tmp.put_u8(self.target_system);
28184 if matches!(version, MavlinkVersion::V2) {
28185 __tmp.put_u64_le(self.time_usec);
28186 let len = __tmp.len();
28187 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28188 } else {
28189 __tmp.len()
28190 }
28191 }
28192}
28193#[deprecated = "Use COMMAND_LONG with MAV_CMD_DO_SET_MODE instead. See `MAV_CMD_DO_SET_MODE` (Deprecated since 2015-12)"]
28194#[doc = "Set the system mode, as defined by enum MAV_MODE. There is no target component id as the mode is by definition for the overall aircraft, not only for one component."]
28195#[doc = ""]
28196#[doc = "ID: 11"]
28197#[derive(Debug, Clone, PartialEq)]
28198#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28199#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28200#[cfg_attr(feature = "ts", derive(TS))]
28201#[cfg_attr(feature = "ts", ts(export))]
28202pub struct SET_MODE_DATA {
28203 #[doc = "The new autopilot-specific mode. This field can be ignored by an autopilot."]
28204 pub custom_mode: u32,
28205 #[doc = "The system setting the mode"]
28206 pub target_system: u8,
28207 #[doc = "The new base mode."]
28208 pub base_mode: MavMode,
28209}
28210impl SET_MODE_DATA {
28211 pub const ENCODED_LEN: usize = 6usize;
28212 pub const DEFAULT: Self = Self {
28213 custom_mode: 0_u32,
28214 target_system: 0_u8,
28215 base_mode: MavMode::DEFAULT,
28216 };
28217 #[cfg(feature = "arbitrary")]
28218 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28219 use arbitrary::{Arbitrary, Unstructured};
28220 let mut buf = [0u8; 1024];
28221 rng.fill_bytes(&mut buf);
28222 let mut unstructured = Unstructured::new(&buf);
28223 Self::arbitrary(&mut unstructured).unwrap_or_default()
28224 }
28225}
28226impl Default for SET_MODE_DATA {
28227 fn default() -> Self {
28228 Self::DEFAULT.clone()
28229 }
28230}
28231impl MessageData for SET_MODE_DATA {
28232 type Message = MavMessage;
28233 const ID: u32 = 11u32;
28234 const NAME: &'static str = "SET_MODE";
28235 const EXTRA_CRC: u8 = 89u8;
28236 const ENCODED_LEN: usize = 6usize;
28237 fn deser(
28238 _version: MavlinkVersion,
28239 __input: &[u8],
28240 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28241 let avail_len = __input.len();
28242 let mut payload_buf = [0; Self::ENCODED_LEN];
28243 let mut buf = if avail_len < Self::ENCODED_LEN {
28244 payload_buf[0..avail_len].copy_from_slice(__input);
28245 Bytes::new(&payload_buf)
28246 } else {
28247 Bytes::new(__input)
28248 };
28249 let mut __struct = Self::default();
28250 __struct.custom_mode = buf.get_u32_le();
28251 __struct.target_system = buf.get_u8();
28252 let tmp = buf.get_u8();
28253 __struct.base_mode =
28254 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28255 enum_type: "MavMode",
28256 value: tmp as u64,
28257 })?;
28258 Ok(__struct)
28259 }
28260 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28261 let mut __tmp = BytesMut::new(bytes);
28262 #[allow(clippy::absurd_extreme_comparisons)]
28263 #[allow(unused_comparisons)]
28264 if __tmp.remaining() < Self::ENCODED_LEN {
28265 panic!(
28266 "buffer is too small (need {} bytes, but got {})",
28267 Self::ENCODED_LEN,
28268 __tmp.remaining(),
28269 )
28270 }
28271 __tmp.put_u32_le(self.custom_mode);
28272 __tmp.put_u8(self.target_system);
28273 __tmp.put_u8(self.base_mode as u8);
28274 if matches!(version, MavlinkVersion::V2) {
28275 let len = __tmp.len();
28276 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28277 } else {
28278 __tmp.len()
28279 }
28280 }
28281}
28282#[doc = "Sets a desired vehicle position, velocity, and/or acceleration in a global coordinate system (WGS84). Used by an external controller to command the vehicle (manual controller or other system)."]
28283#[doc = ""]
28284#[doc = "ID: 86"]
28285#[derive(Debug, Clone, PartialEq)]
28286#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28287#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28288#[cfg_attr(feature = "ts", derive(TS))]
28289#[cfg_attr(feature = "ts", ts(export))]
28290pub struct SET_POSITION_TARGET_GLOBAL_INT_DATA {
28291 #[doc = "Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency."]
28292 pub time_boot_ms: u32,
28293 #[doc = "Latitude in WGS84 frame"]
28294 pub lat_int: i32,
28295 #[doc = "Longitude in WGS84 frame"]
28296 pub lon_int: i32,
28297 #[doc = "Altitude (MSL, Relative to home, or AGL - depending on frame)"]
28298 pub alt: f32,
28299 #[doc = "X velocity in NED frame"]
28300 pub vx: f32,
28301 #[doc = "Y velocity in NED frame"]
28302 pub vy: f32,
28303 #[doc = "Z velocity in NED frame"]
28304 pub vz: f32,
28305 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
28306 pub afx: f32,
28307 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
28308 pub afy: f32,
28309 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
28310 pub afz: f32,
28311 #[doc = "yaw setpoint"]
28312 pub yaw: f32,
28313 #[doc = "yaw rate setpoint"]
28314 pub yaw_rate: f32,
28315 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
28316 pub type_mask: PositionTargetTypemask,
28317 #[doc = "System ID"]
28318 pub target_system: u8,
28319 #[doc = "Component ID"]
28320 pub target_component: u8,
28321 #[doc = "Valid options are: MAV_FRAME_GLOBAL = 0, MAV_FRAME_GLOBAL_RELATIVE_ALT = 3, MAV_FRAME_GLOBAL_TERRAIN_ALT = 10 (MAV_FRAME_GLOBAL_INT, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT are allowed synonyms, but have been deprecated)"]
28322 pub coordinate_frame: MavFrame,
28323}
28324impl SET_POSITION_TARGET_GLOBAL_INT_DATA {
28325 pub const ENCODED_LEN: usize = 53usize;
28326 pub const DEFAULT: Self = Self {
28327 time_boot_ms: 0_u32,
28328 lat_int: 0_i32,
28329 lon_int: 0_i32,
28330 alt: 0.0_f32,
28331 vx: 0.0_f32,
28332 vy: 0.0_f32,
28333 vz: 0.0_f32,
28334 afx: 0.0_f32,
28335 afy: 0.0_f32,
28336 afz: 0.0_f32,
28337 yaw: 0.0_f32,
28338 yaw_rate: 0.0_f32,
28339 type_mask: PositionTargetTypemask::DEFAULT,
28340 target_system: 0_u8,
28341 target_component: 0_u8,
28342 coordinate_frame: MavFrame::DEFAULT,
28343 };
28344 #[cfg(feature = "arbitrary")]
28345 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28346 use arbitrary::{Arbitrary, Unstructured};
28347 let mut buf = [0u8; 1024];
28348 rng.fill_bytes(&mut buf);
28349 let mut unstructured = Unstructured::new(&buf);
28350 Self::arbitrary(&mut unstructured).unwrap_or_default()
28351 }
28352}
28353impl Default for SET_POSITION_TARGET_GLOBAL_INT_DATA {
28354 fn default() -> Self {
28355 Self::DEFAULT.clone()
28356 }
28357}
28358impl MessageData for SET_POSITION_TARGET_GLOBAL_INT_DATA {
28359 type Message = MavMessage;
28360 const ID: u32 = 86u32;
28361 const NAME: &'static str = "SET_POSITION_TARGET_GLOBAL_INT";
28362 const EXTRA_CRC: u8 = 5u8;
28363 const ENCODED_LEN: usize = 53usize;
28364 fn deser(
28365 _version: MavlinkVersion,
28366 __input: &[u8],
28367 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28368 let avail_len = __input.len();
28369 let mut payload_buf = [0; Self::ENCODED_LEN];
28370 let mut buf = if avail_len < Self::ENCODED_LEN {
28371 payload_buf[0..avail_len].copy_from_slice(__input);
28372 Bytes::new(&payload_buf)
28373 } else {
28374 Bytes::new(__input)
28375 };
28376 let mut __struct = Self::default();
28377 __struct.time_boot_ms = buf.get_u32_le();
28378 __struct.lat_int = buf.get_i32_le();
28379 __struct.lon_int = buf.get_i32_le();
28380 __struct.alt = buf.get_f32_le();
28381 __struct.vx = buf.get_f32_le();
28382 __struct.vy = buf.get_f32_le();
28383 __struct.vz = buf.get_f32_le();
28384 __struct.afx = buf.get_f32_le();
28385 __struct.afy = buf.get_f32_le();
28386 __struct.afz = buf.get_f32_le();
28387 __struct.yaw = buf.get_f32_le();
28388 __struct.yaw_rate = buf.get_f32_le();
28389 let tmp = buf.get_u16_le();
28390 __struct.type_mask = PositionTargetTypemask::from_bits(tmp).ok_or(
28391 ::mavlink_core::error::ParserError::InvalidFlag {
28392 flag_type: "PositionTargetTypemask",
28393 value: tmp as u64,
28394 },
28395 )?;
28396 __struct.target_system = buf.get_u8();
28397 __struct.target_component = buf.get_u8();
28398 let tmp = buf.get_u8();
28399 __struct.coordinate_frame =
28400 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28401 enum_type: "MavFrame",
28402 value: tmp as u64,
28403 })?;
28404 Ok(__struct)
28405 }
28406 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28407 let mut __tmp = BytesMut::new(bytes);
28408 #[allow(clippy::absurd_extreme_comparisons)]
28409 #[allow(unused_comparisons)]
28410 if __tmp.remaining() < Self::ENCODED_LEN {
28411 panic!(
28412 "buffer is too small (need {} bytes, but got {})",
28413 Self::ENCODED_LEN,
28414 __tmp.remaining(),
28415 )
28416 }
28417 __tmp.put_u32_le(self.time_boot_ms);
28418 __tmp.put_i32_le(self.lat_int);
28419 __tmp.put_i32_le(self.lon_int);
28420 __tmp.put_f32_le(self.alt);
28421 __tmp.put_f32_le(self.vx);
28422 __tmp.put_f32_le(self.vy);
28423 __tmp.put_f32_le(self.vz);
28424 __tmp.put_f32_le(self.afx);
28425 __tmp.put_f32_le(self.afy);
28426 __tmp.put_f32_le(self.afz);
28427 __tmp.put_f32_le(self.yaw);
28428 __tmp.put_f32_le(self.yaw_rate);
28429 __tmp.put_u16_le(self.type_mask.bits());
28430 __tmp.put_u8(self.target_system);
28431 __tmp.put_u8(self.target_component);
28432 __tmp.put_u8(self.coordinate_frame as u8);
28433 if matches!(version, MavlinkVersion::V2) {
28434 let len = __tmp.len();
28435 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28436 } else {
28437 __tmp.len()
28438 }
28439 }
28440}
28441#[doc = "Sets a desired vehicle position in a local north-east-down coordinate frame. Used by an external controller to command the vehicle (manual controller or other system)."]
28442#[doc = ""]
28443#[doc = "ID: 84"]
28444#[derive(Debug, Clone, PartialEq)]
28445#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28446#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28447#[cfg_attr(feature = "ts", derive(TS))]
28448#[cfg_attr(feature = "ts", ts(export))]
28449pub struct SET_POSITION_TARGET_LOCAL_NED_DATA {
28450 #[doc = "Timestamp (time since system boot)."]
28451 pub time_boot_ms: u32,
28452 #[doc = "X Position in NED frame"]
28453 pub x: f32,
28454 #[doc = "Y Position in NED frame"]
28455 pub y: f32,
28456 #[doc = "Z Position in NED frame (note, altitude is negative in NED)"]
28457 pub z: f32,
28458 #[doc = "X velocity in NED frame"]
28459 pub vx: f32,
28460 #[doc = "Y velocity in NED frame"]
28461 pub vy: f32,
28462 #[doc = "Z velocity in NED frame"]
28463 pub vz: f32,
28464 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
28465 pub afx: f32,
28466 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
28467 pub afy: f32,
28468 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
28469 pub afz: f32,
28470 #[doc = "yaw setpoint"]
28471 pub yaw: f32,
28472 #[doc = "yaw rate setpoint"]
28473 pub yaw_rate: f32,
28474 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
28475 pub type_mask: PositionTargetTypemask,
28476 #[doc = "System ID"]
28477 pub target_system: u8,
28478 #[doc = "Component ID"]
28479 pub target_component: u8,
28480 #[doc = "Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9"]
28481 pub coordinate_frame: MavFrame,
28482}
28483impl SET_POSITION_TARGET_LOCAL_NED_DATA {
28484 pub const ENCODED_LEN: usize = 53usize;
28485 pub const DEFAULT: Self = Self {
28486 time_boot_ms: 0_u32,
28487 x: 0.0_f32,
28488 y: 0.0_f32,
28489 z: 0.0_f32,
28490 vx: 0.0_f32,
28491 vy: 0.0_f32,
28492 vz: 0.0_f32,
28493 afx: 0.0_f32,
28494 afy: 0.0_f32,
28495 afz: 0.0_f32,
28496 yaw: 0.0_f32,
28497 yaw_rate: 0.0_f32,
28498 type_mask: PositionTargetTypemask::DEFAULT,
28499 target_system: 0_u8,
28500 target_component: 0_u8,
28501 coordinate_frame: MavFrame::DEFAULT,
28502 };
28503 #[cfg(feature = "arbitrary")]
28504 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28505 use arbitrary::{Arbitrary, Unstructured};
28506 let mut buf = [0u8; 1024];
28507 rng.fill_bytes(&mut buf);
28508 let mut unstructured = Unstructured::new(&buf);
28509 Self::arbitrary(&mut unstructured).unwrap_or_default()
28510 }
28511}
28512impl Default for SET_POSITION_TARGET_LOCAL_NED_DATA {
28513 fn default() -> Self {
28514 Self::DEFAULT.clone()
28515 }
28516}
28517impl MessageData for SET_POSITION_TARGET_LOCAL_NED_DATA {
28518 type Message = MavMessage;
28519 const ID: u32 = 84u32;
28520 const NAME: &'static str = "SET_POSITION_TARGET_LOCAL_NED";
28521 const EXTRA_CRC: u8 = 143u8;
28522 const ENCODED_LEN: usize = 53usize;
28523 fn deser(
28524 _version: MavlinkVersion,
28525 __input: &[u8],
28526 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28527 let avail_len = __input.len();
28528 let mut payload_buf = [0; Self::ENCODED_LEN];
28529 let mut buf = if avail_len < Self::ENCODED_LEN {
28530 payload_buf[0..avail_len].copy_from_slice(__input);
28531 Bytes::new(&payload_buf)
28532 } else {
28533 Bytes::new(__input)
28534 };
28535 let mut __struct = Self::default();
28536 __struct.time_boot_ms = buf.get_u32_le();
28537 __struct.x = buf.get_f32_le();
28538 __struct.y = buf.get_f32_le();
28539 __struct.z = buf.get_f32_le();
28540 __struct.vx = buf.get_f32_le();
28541 __struct.vy = buf.get_f32_le();
28542 __struct.vz = buf.get_f32_le();
28543 __struct.afx = buf.get_f32_le();
28544 __struct.afy = buf.get_f32_le();
28545 __struct.afz = buf.get_f32_le();
28546 __struct.yaw = buf.get_f32_le();
28547 __struct.yaw_rate = buf.get_f32_le();
28548 let tmp = buf.get_u16_le();
28549 __struct.type_mask = PositionTargetTypemask::from_bits(tmp).ok_or(
28550 ::mavlink_core::error::ParserError::InvalidFlag {
28551 flag_type: "PositionTargetTypemask",
28552 value: tmp as u64,
28553 },
28554 )?;
28555 __struct.target_system = buf.get_u8();
28556 __struct.target_component = buf.get_u8();
28557 let tmp = buf.get_u8();
28558 __struct.coordinate_frame =
28559 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28560 enum_type: "MavFrame",
28561 value: tmp as u64,
28562 })?;
28563 Ok(__struct)
28564 }
28565 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28566 let mut __tmp = BytesMut::new(bytes);
28567 #[allow(clippy::absurd_extreme_comparisons)]
28568 #[allow(unused_comparisons)]
28569 if __tmp.remaining() < Self::ENCODED_LEN {
28570 panic!(
28571 "buffer is too small (need {} bytes, but got {})",
28572 Self::ENCODED_LEN,
28573 __tmp.remaining(),
28574 )
28575 }
28576 __tmp.put_u32_le(self.time_boot_ms);
28577 __tmp.put_f32_le(self.x);
28578 __tmp.put_f32_le(self.y);
28579 __tmp.put_f32_le(self.z);
28580 __tmp.put_f32_le(self.vx);
28581 __tmp.put_f32_le(self.vy);
28582 __tmp.put_f32_le(self.vz);
28583 __tmp.put_f32_le(self.afx);
28584 __tmp.put_f32_le(self.afy);
28585 __tmp.put_f32_le(self.afz);
28586 __tmp.put_f32_le(self.yaw);
28587 __tmp.put_f32_le(self.yaw_rate);
28588 __tmp.put_u16_le(self.type_mask.bits());
28589 __tmp.put_u8(self.target_system);
28590 __tmp.put_u8(self.target_component);
28591 __tmp.put_u8(self.coordinate_frame as u8);
28592 if matches!(version, MavlinkVersion::V2) {
28593 let len = __tmp.len();
28594 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28595 } else {
28596 __tmp.len()
28597 }
28598 }
28599}
28600#[doc = "Status of simulation environment, if used."]
28601#[doc = ""]
28602#[doc = "ID: 108"]
28603#[derive(Debug, Clone, PartialEq)]
28604#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28605#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28606#[cfg_attr(feature = "ts", derive(TS))]
28607#[cfg_attr(feature = "ts", ts(export))]
28608pub struct SIM_STATE_DATA {
28609 #[doc = "True attitude quaternion component 1, w (1 in null-rotation)"]
28610 pub q1: f32,
28611 #[doc = "True attitude quaternion component 2, x (0 in null-rotation)"]
28612 pub q2: f32,
28613 #[doc = "True attitude quaternion component 3, y (0 in null-rotation)"]
28614 pub q3: f32,
28615 #[doc = "True attitude quaternion component 4, z (0 in null-rotation)"]
28616 pub q4: f32,
28617 #[doc = "Attitude roll expressed as Euler angles, not recommended except for human-readable outputs"]
28618 pub roll: f32,
28619 #[doc = "Attitude pitch expressed as Euler angles, not recommended except for human-readable outputs"]
28620 pub pitch: f32,
28621 #[doc = "Attitude yaw expressed as Euler angles, not recommended except for human-readable outputs"]
28622 pub yaw: f32,
28623 #[doc = "X acceleration"]
28624 pub xacc: f32,
28625 #[doc = "Y acceleration"]
28626 pub yacc: f32,
28627 #[doc = "Z acceleration"]
28628 pub zacc: f32,
28629 #[doc = "Angular speed around X axis"]
28630 pub xgyro: f32,
28631 #[doc = "Angular speed around Y axis"]
28632 pub ygyro: f32,
28633 #[doc = "Angular speed around Z axis"]
28634 pub zgyro: f32,
28635 #[doc = "Latitude (lower precision). Both this and the lat_int field should be set."]
28636 pub lat: f32,
28637 #[doc = "Longitude (lower precision). Both this and the lon_int field should be set."]
28638 pub lon: f32,
28639 #[doc = "Altitude"]
28640 pub alt: f32,
28641 #[doc = "Horizontal position standard deviation"]
28642 pub std_dev_horz: f32,
28643 #[doc = "Vertical position standard deviation"]
28644 pub std_dev_vert: f32,
28645 #[doc = "True velocity in north direction in earth-fixed NED frame"]
28646 pub vn: f32,
28647 #[doc = "True velocity in east direction in earth-fixed NED frame"]
28648 pub ve: f32,
28649 #[doc = "True velocity in down direction in earth-fixed NED frame"]
28650 pub vd: f32,
28651 #[doc = "Latitude (higher precision). If 0, recipients should use the lat field value (otherwise this field is preferred)."]
28652 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28653 pub lat_int: i32,
28654 #[doc = "Longitude (higher precision). If 0, recipients should use the lon field value (otherwise this field is preferred)."]
28655 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28656 pub lon_int: i32,
28657}
28658impl SIM_STATE_DATA {
28659 pub const ENCODED_LEN: usize = 92usize;
28660 pub const DEFAULT: Self = Self {
28661 q1: 0.0_f32,
28662 q2: 0.0_f32,
28663 q3: 0.0_f32,
28664 q4: 0.0_f32,
28665 roll: 0.0_f32,
28666 pitch: 0.0_f32,
28667 yaw: 0.0_f32,
28668 xacc: 0.0_f32,
28669 yacc: 0.0_f32,
28670 zacc: 0.0_f32,
28671 xgyro: 0.0_f32,
28672 ygyro: 0.0_f32,
28673 zgyro: 0.0_f32,
28674 lat: 0.0_f32,
28675 lon: 0.0_f32,
28676 alt: 0.0_f32,
28677 std_dev_horz: 0.0_f32,
28678 std_dev_vert: 0.0_f32,
28679 vn: 0.0_f32,
28680 ve: 0.0_f32,
28681 vd: 0.0_f32,
28682 lat_int: 0_i32,
28683 lon_int: 0_i32,
28684 };
28685 #[cfg(feature = "arbitrary")]
28686 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28687 use arbitrary::{Arbitrary, Unstructured};
28688 let mut buf = [0u8; 1024];
28689 rng.fill_bytes(&mut buf);
28690 let mut unstructured = Unstructured::new(&buf);
28691 Self::arbitrary(&mut unstructured).unwrap_or_default()
28692 }
28693}
28694impl Default for SIM_STATE_DATA {
28695 fn default() -> Self {
28696 Self::DEFAULT.clone()
28697 }
28698}
28699impl MessageData for SIM_STATE_DATA {
28700 type Message = MavMessage;
28701 const ID: u32 = 108u32;
28702 const NAME: &'static str = "SIM_STATE";
28703 const EXTRA_CRC: u8 = 32u8;
28704 const ENCODED_LEN: usize = 92usize;
28705 fn deser(
28706 _version: MavlinkVersion,
28707 __input: &[u8],
28708 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28709 let avail_len = __input.len();
28710 let mut payload_buf = [0; Self::ENCODED_LEN];
28711 let mut buf = if avail_len < Self::ENCODED_LEN {
28712 payload_buf[0..avail_len].copy_from_slice(__input);
28713 Bytes::new(&payload_buf)
28714 } else {
28715 Bytes::new(__input)
28716 };
28717 let mut __struct = Self::default();
28718 __struct.q1 = buf.get_f32_le();
28719 __struct.q2 = buf.get_f32_le();
28720 __struct.q3 = buf.get_f32_le();
28721 __struct.q4 = buf.get_f32_le();
28722 __struct.roll = buf.get_f32_le();
28723 __struct.pitch = buf.get_f32_le();
28724 __struct.yaw = buf.get_f32_le();
28725 __struct.xacc = buf.get_f32_le();
28726 __struct.yacc = buf.get_f32_le();
28727 __struct.zacc = buf.get_f32_le();
28728 __struct.xgyro = buf.get_f32_le();
28729 __struct.ygyro = buf.get_f32_le();
28730 __struct.zgyro = buf.get_f32_le();
28731 __struct.lat = buf.get_f32_le();
28732 __struct.lon = buf.get_f32_le();
28733 __struct.alt = buf.get_f32_le();
28734 __struct.std_dev_horz = buf.get_f32_le();
28735 __struct.std_dev_vert = buf.get_f32_le();
28736 __struct.vn = buf.get_f32_le();
28737 __struct.ve = buf.get_f32_le();
28738 __struct.vd = buf.get_f32_le();
28739 __struct.lat_int = buf.get_i32_le();
28740 __struct.lon_int = buf.get_i32_le();
28741 Ok(__struct)
28742 }
28743 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28744 let mut __tmp = BytesMut::new(bytes);
28745 #[allow(clippy::absurd_extreme_comparisons)]
28746 #[allow(unused_comparisons)]
28747 if __tmp.remaining() < Self::ENCODED_LEN {
28748 panic!(
28749 "buffer is too small (need {} bytes, but got {})",
28750 Self::ENCODED_LEN,
28751 __tmp.remaining(),
28752 )
28753 }
28754 __tmp.put_f32_le(self.q1);
28755 __tmp.put_f32_le(self.q2);
28756 __tmp.put_f32_le(self.q3);
28757 __tmp.put_f32_le(self.q4);
28758 __tmp.put_f32_le(self.roll);
28759 __tmp.put_f32_le(self.pitch);
28760 __tmp.put_f32_le(self.yaw);
28761 __tmp.put_f32_le(self.xacc);
28762 __tmp.put_f32_le(self.yacc);
28763 __tmp.put_f32_le(self.zacc);
28764 __tmp.put_f32_le(self.xgyro);
28765 __tmp.put_f32_le(self.ygyro);
28766 __tmp.put_f32_le(self.zgyro);
28767 __tmp.put_f32_le(self.lat);
28768 __tmp.put_f32_le(self.lon);
28769 __tmp.put_f32_le(self.alt);
28770 __tmp.put_f32_le(self.std_dev_horz);
28771 __tmp.put_f32_le(self.std_dev_vert);
28772 __tmp.put_f32_le(self.vn);
28773 __tmp.put_f32_le(self.ve);
28774 __tmp.put_f32_le(self.vd);
28775 if matches!(version, MavlinkVersion::V2) {
28776 __tmp.put_i32_le(self.lat_int);
28777 __tmp.put_i32_le(self.lon_int);
28778 let len = __tmp.len();
28779 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28780 } else {
28781 __tmp.len()
28782 }
28783 }
28784}
28785#[deprecated = "The BATTERY_INFO message is better aligned with UAVCAN messages, and in any case is useful even if a battery is not \"smart\". See `BATTERY_INFO` (Deprecated since 2024-02)"]
28786#[doc = "Smart Battery information (static/infrequent update). Use for updates from: smart battery to flight stack, flight stack to GCS. Use BATTERY_STATUS for the frequent battery updates."]
28787#[doc = ""]
28788#[doc = "ID: 370"]
28789#[derive(Debug, Clone, PartialEq)]
28790#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28791#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28792#[cfg_attr(feature = "ts", derive(TS))]
28793#[cfg_attr(feature = "ts", ts(export))]
28794pub struct SMART_BATTERY_INFO_DATA {
28795 #[doc = "Capacity when full according to manufacturer, -1: field not provided."]
28796 pub capacity_full_specification: i32,
28797 #[doc = "Capacity when full (accounting for battery degradation), -1: field not provided."]
28798 pub capacity_full: i32,
28799 #[doc = "Charge/discharge cycle count. UINT16_MAX: field not provided."]
28800 pub cycle_count: u16,
28801 #[doc = "Battery weight. 0: field not provided."]
28802 pub weight: u16,
28803 #[doc = "Minimum per-cell voltage when discharging. If not supplied set to UINT16_MAX value."]
28804 pub discharge_minimum_voltage: u16,
28805 #[doc = "Minimum per-cell voltage when charging. If not supplied set to UINT16_MAX value."]
28806 pub charging_minimum_voltage: u16,
28807 #[doc = "Minimum per-cell voltage when resting. If not supplied set to UINT16_MAX value."]
28808 pub resting_minimum_voltage: u16,
28809 #[doc = "Battery ID"]
28810 pub id: u8,
28811 #[doc = "Function of the battery"]
28812 pub battery_function: MavBatteryFunction,
28813 #[doc = "Type (chemistry) of the battery"]
28814 pub mavtype: MavBatteryType,
28815 #[doc = "Serial number in ASCII characters, 0 terminated. All 0: field not provided."]
28816 #[cfg_attr(feature = "ts", ts(type = "string"))]
28817 pub serial_number: CharArray<16>,
28818 #[doc = "Static device name in ASCII characters, 0 terminated. All 0: field not provided. Encode as manufacturer name then product name separated using an underscore."]
28819 #[cfg_attr(feature = "ts", ts(type = "string"))]
28820 pub device_name: CharArray<50>,
28821 #[doc = "Maximum per-cell voltage when charged. 0: field not provided."]
28822 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28823 pub charging_maximum_voltage: u16,
28824 #[doc = "Number of battery cells in series. 0: field not provided."]
28825 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28826 pub cells_in_series: u8,
28827 #[doc = "Maximum pack discharge current. 0: field not provided."]
28828 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28829 pub discharge_maximum_current: u32,
28830 #[doc = "Maximum pack discharge burst current. 0: field not provided."]
28831 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28832 pub discharge_maximum_burst_current: u32,
28833 #[doc = "Manufacture date (DD/MM/YYYY) in ASCII characters, 0 terminated. All 0: field not provided."]
28834 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28835 #[cfg_attr(feature = "ts", ts(type = "string"))]
28836 pub manufacture_date: CharArray<11>,
28837}
28838impl SMART_BATTERY_INFO_DATA {
28839 pub const ENCODED_LEN: usize = 109usize;
28840 pub const DEFAULT: Self = Self {
28841 capacity_full_specification: 0_i32,
28842 capacity_full: 0_i32,
28843 cycle_count: 0_u16,
28844 weight: 0_u16,
28845 discharge_minimum_voltage: 0_u16,
28846 charging_minimum_voltage: 0_u16,
28847 resting_minimum_voltage: 0_u16,
28848 id: 0_u8,
28849 battery_function: MavBatteryFunction::DEFAULT,
28850 mavtype: MavBatteryType::DEFAULT,
28851 serial_number: CharArray::new([0_u8; 16usize]),
28852 device_name: CharArray::new([0_u8; 50usize]),
28853 charging_maximum_voltage: 0_u16,
28854 cells_in_series: 0_u8,
28855 discharge_maximum_current: 0_u32,
28856 discharge_maximum_burst_current: 0_u32,
28857 manufacture_date: CharArray::new([0_u8; 11usize]),
28858 };
28859 #[cfg(feature = "arbitrary")]
28860 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28861 use arbitrary::{Arbitrary, Unstructured};
28862 let mut buf = [0u8; 1024];
28863 rng.fill_bytes(&mut buf);
28864 let mut unstructured = Unstructured::new(&buf);
28865 Self::arbitrary(&mut unstructured).unwrap_or_default()
28866 }
28867}
28868impl Default for SMART_BATTERY_INFO_DATA {
28869 fn default() -> Self {
28870 Self::DEFAULT.clone()
28871 }
28872}
28873impl MessageData for SMART_BATTERY_INFO_DATA {
28874 type Message = MavMessage;
28875 const ID: u32 = 370u32;
28876 const NAME: &'static str = "SMART_BATTERY_INFO";
28877 const EXTRA_CRC: u8 = 75u8;
28878 const ENCODED_LEN: usize = 109usize;
28879 fn deser(
28880 _version: MavlinkVersion,
28881 __input: &[u8],
28882 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28883 let avail_len = __input.len();
28884 let mut payload_buf = [0; Self::ENCODED_LEN];
28885 let mut buf = if avail_len < Self::ENCODED_LEN {
28886 payload_buf[0..avail_len].copy_from_slice(__input);
28887 Bytes::new(&payload_buf)
28888 } else {
28889 Bytes::new(__input)
28890 };
28891 let mut __struct = Self::default();
28892 __struct.capacity_full_specification = buf.get_i32_le();
28893 __struct.capacity_full = buf.get_i32_le();
28894 __struct.cycle_count = buf.get_u16_le();
28895 __struct.weight = buf.get_u16_le();
28896 __struct.discharge_minimum_voltage = buf.get_u16_le();
28897 __struct.charging_minimum_voltage = buf.get_u16_le();
28898 __struct.resting_minimum_voltage = buf.get_u16_le();
28899 __struct.id = buf.get_u8();
28900 let tmp = buf.get_u8();
28901 __struct.battery_function =
28902 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28903 enum_type: "MavBatteryFunction",
28904 value: tmp as u64,
28905 })?;
28906 let tmp = buf.get_u8();
28907 __struct.mavtype =
28908 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28909 enum_type: "MavBatteryType",
28910 value: tmp as u64,
28911 })?;
28912 let mut tmp = [0_u8; 16usize];
28913 for v in &mut tmp {
28914 *v = buf.get_u8();
28915 }
28916 __struct.serial_number = CharArray::new(tmp);
28917 let mut tmp = [0_u8; 50usize];
28918 for v in &mut tmp {
28919 *v = buf.get_u8();
28920 }
28921 __struct.device_name = CharArray::new(tmp);
28922 __struct.charging_maximum_voltage = buf.get_u16_le();
28923 __struct.cells_in_series = buf.get_u8();
28924 __struct.discharge_maximum_current = buf.get_u32_le();
28925 __struct.discharge_maximum_burst_current = buf.get_u32_le();
28926 let mut tmp = [0_u8; 11usize];
28927 for v in &mut tmp {
28928 *v = buf.get_u8();
28929 }
28930 __struct.manufacture_date = CharArray::new(tmp);
28931 Ok(__struct)
28932 }
28933 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28934 let mut __tmp = BytesMut::new(bytes);
28935 #[allow(clippy::absurd_extreme_comparisons)]
28936 #[allow(unused_comparisons)]
28937 if __tmp.remaining() < Self::ENCODED_LEN {
28938 panic!(
28939 "buffer is too small (need {} bytes, but got {})",
28940 Self::ENCODED_LEN,
28941 __tmp.remaining(),
28942 )
28943 }
28944 __tmp.put_i32_le(self.capacity_full_specification);
28945 __tmp.put_i32_le(self.capacity_full);
28946 __tmp.put_u16_le(self.cycle_count);
28947 __tmp.put_u16_le(self.weight);
28948 __tmp.put_u16_le(self.discharge_minimum_voltage);
28949 __tmp.put_u16_le(self.charging_minimum_voltage);
28950 __tmp.put_u16_le(self.resting_minimum_voltage);
28951 __tmp.put_u8(self.id);
28952 __tmp.put_u8(self.battery_function as u8);
28953 __tmp.put_u8(self.mavtype as u8);
28954 for val in &self.serial_number {
28955 __tmp.put_u8(*val);
28956 }
28957 for val in &self.device_name {
28958 __tmp.put_u8(*val);
28959 }
28960 if matches!(version, MavlinkVersion::V2) {
28961 __tmp.put_u16_le(self.charging_maximum_voltage);
28962 __tmp.put_u8(self.cells_in_series);
28963 __tmp.put_u32_le(self.discharge_maximum_current);
28964 __tmp.put_u32_le(self.discharge_maximum_burst_current);
28965 for val in &self.manufacture_date {
28966 __tmp.put_u8(*val);
28967 }
28968 let len = __tmp.len();
28969 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28970 } else {
28971 __tmp.len()
28972 }
28973 }
28974}
28975#[doc = "Status text message. These messages are printed in yellow in the COMM console of QGroundControl. WARNING: They consume quite some bandwidth, so use only for important status and error messages. If implemented wisely, these messages are buffered on the MCU and sent only at a limited rate (e.g. 10 Hz)."]
28976#[doc = ""]
28977#[doc = "ID: 253"]
28978#[derive(Debug, Clone, PartialEq)]
28979#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28980#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28981#[cfg_attr(feature = "ts", derive(TS))]
28982#[cfg_attr(feature = "ts", ts(export))]
28983pub struct STATUSTEXT_DATA {
28984 #[doc = "Severity of status. Relies on the definitions within RFC-5424."]
28985 pub severity: MavSeverity,
28986 #[doc = "Status text message, without null termination character"]
28987 #[cfg_attr(feature = "ts", ts(type = "string"))]
28988 pub text: CharArray<50>,
28989 #[doc = "Unique (opaque) identifier for this statustext message. May be used to reassemble a logical long-statustext message from a sequence of chunks. A value of zero indicates this is the only chunk in the sequence and the message can be emitted immediately."]
28990 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28991 pub id: u16,
28992 #[doc = "This chunk's sequence number; indexing is from zero. Any null character in the text field is taken to mean this was the last chunk."]
28993 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28994 pub chunk_seq: u8,
28995}
28996impl STATUSTEXT_DATA {
28997 pub const ENCODED_LEN: usize = 54usize;
28998 pub const DEFAULT: Self = Self {
28999 severity: MavSeverity::DEFAULT,
29000 text: CharArray::new([0_u8; 50usize]),
29001 id: 0_u16,
29002 chunk_seq: 0_u8,
29003 };
29004 #[cfg(feature = "arbitrary")]
29005 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29006 use arbitrary::{Arbitrary, Unstructured};
29007 let mut buf = [0u8; 1024];
29008 rng.fill_bytes(&mut buf);
29009 let mut unstructured = Unstructured::new(&buf);
29010 Self::arbitrary(&mut unstructured).unwrap_or_default()
29011 }
29012}
29013impl Default for STATUSTEXT_DATA {
29014 fn default() -> Self {
29015 Self::DEFAULT.clone()
29016 }
29017}
29018impl MessageData for STATUSTEXT_DATA {
29019 type Message = MavMessage;
29020 const ID: u32 = 253u32;
29021 const NAME: &'static str = "STATUSTEXT";
29022 const EXTRA_CRC: u8 = 83u8;
29023 const ENCODED_LEN: usize = 54usize;
29024 fn deser(
29025 _version: MavlinkVersion,
29026 __input: &[u8],
29027 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29028 let avail_len = __input.len();
29029 let mut payload_buf = [0; Self::ENCODED_LEN];
29030 let mut buf = if avail_len < Self::ENCODED_LEN {
29031 payload_buf[0..avail_len].copy_from_slice(__input);
29032 Bytes::new(&payload_buf)
29033 } else {
29034 Bytes::new(__input)
29035 };
29036 let mut __struct = Self::default();
29037 let tmp = buf.get_u8();
29038 __struct.severity =
29039 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29040 enum_type: "MavSeverity",
29041 value: tmp as u64,
29042 })?;
29043 let mut tmp = [0_u8; 50usize];
29044 for v in &mut tmp {
29045 *v = buf.get_u8();
29046 }
29047 __struct.text = CharArray::new(tmp);
29048 __struct.id = buf.get_u16_le();
29049 __struct.chunk_seq = buf.get_u8();
29050 Ok(__struct)
29051 }
29052 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29053 let mut __tmp = BytesMut::new(bytes);
29054 #[allow(clippy::absurd_extreme_comparisons)]
29055 #[allow(unused_comparisons)]
29056 if __tmp.remaining() < Self::ENCODED_LEN {
29057 panic!(
29058 "buffer is too small (need {} bytes, but got {})",
29059 Self::ENCODED_LEN,
29060 __tmp.remaining(),
29061 )
29062 }
29063 __tmp.put_u8(self.severity as u8);
29064 for val in &self.text {
29065 __tmp.put_u8(*val);
29066 }
29067 if matches!(version, MavlinkVersion::V2) {
29068 __tmp.put_u16_le(self.id);
29069 __tmp.put_u8(self.chunk_seq);
29070 let len = __tmp.len();
29071 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29072 } else {
29073 __tmp.len()
29074 }
29075 }
29076}
29077#[doc = "Information about a storage medium. This message is sent in response to a request with MAV_CMD_REQUEST_MESSAGE and whenever the status of the storage changes (STORAGE_STATUS). Use MAV_CMD_REQUEST_MESSAGE.param2 to indicate the index/id of requested storage: 0 for all, 1 for first, 2 for second, etc."]
29078#[doc = ""]
29079#[doc = "ID: 261"]
29080#[derive(Debug, Clone, PartialEq)]
29081#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29082#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29083#[cfg_attr(feature = "ts", derive(TS))]
29084#[cfg_attr(feature = "ts", ts(export))]
29085pub struct STORAGE_INFORMATION_DATA {
29086 #[doc = "Timestamp (time since system boot)."]
29087 pub time_boot_ms: u32,
29088 #[doc = "Total capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
29089 pub total_capacity: f32,
29090 #[doc = "Used capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
29091 pub used_capacity: f32,
29092 #[doc = "Available storage capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
29093 pub available_capacity: f32,
29094 #[doc = "Read speed."]
29095 pub read_speed: f32,
29096 #[doc = "Write speed."]
29097 pub write_speed: f32,
29098 #[doc = "Storage ID (1 for first, 2 for second, etc.)"]
29099 pub storage_id: u8,
29100 #[doc = "Number of storage devices"]
29101 pub storage_count: u8,
29102 #[doc = "Status of storage"]
29103 pub status: StorageStatus,
29104 #[doc = "Type of storage"]
29105 #[cfg_attr(feature = "serde", serde(default))]
29106 pub mavtype: StorageType,
29107 #[doc = "Textual storage name to be used in UI (microSD 1, Internal Memory, etc.) This is a NULL terminated string. If it is exactly 32 characters long, add a terminating NULL. If this string is empty, the generic type is shown to the user."]
29108 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29109 #[cfg_attr(feature = "ts", ts(type = "string"))]
29110 pub name: CharArray<32>,
29111 #[doc = "Flags indicating whether this instance is preferred storage for photos, videos, etc. Note: Implementations should initially set the flags on the system-default storage id used for saving media (if possible/supported). This setting can then be overridden using MAV_CMD_SET_STORAGE_USAGE. If the media usage flags are not set, a GCS may assume storage ID 1 is the default storage for all media types."]
29112 #[cfg_attr(feature = "serde", serde(default))]
29113 pub storage_usage: StorageUsageFlag,
29114}
29115impl STORAGE_INFORMATION_DATA {
29116 pub const ENCODED_LEN: usize = 61usize;
29117 pub const DEFAULT: Self = Self {
29118 time_boot_ms: 0_u32,
29119 total_capacity: 0.0_f32,
29120 used_capacity: 0.0_f32,
29121 available_capacity: 0.0_f32,
29122 read_speed: 0.0_f32,
29123 write_speed: 0.0_f32,
29124 storage_id: 0_u8,
29125 storage_count: 0_u8,
29126 status: StorageStatus::DEFAULT,
29127 mavtype: StorageType::DEFAULT,
29128 name: CharArray::new([0_u8; 32usize]),
29129 storage_usage: StorageUsageFlag::DEFAULT,
29130 };
29131 #[cfg(feature = "arbitrary")]
29132 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29133 use arbitrary::{Arbitrary, Unstructured};
29134 let mut buf = [0u8; 1024];
29135 rng.fill_bytes(&mut buf);
29136 let mut unstructured = Unstructured::new(&buf);
29137 Self::arbitrary(&mut unstructured).unwrap_or_default()
29138 }
29139}
29140impl Default for STORAGE_INFORMATION_DATA {
29141 fn default() -> Self {
29142 Self::DEFAULT.clone()
29143 }
29144}
29145impl MessageData for STORAGE_INFORMATION_DATA {
29146 type Message = MavMessage;
29147 const ID: u32 = 261u32;
29148 const NAME: &'static str = "STORAGE_INFORMATION";
29149 const EXTRA_CRC: u8 = 179u8;
29150 const ENCODED_LEN: usize = 61usize;
29151 fn deser(
29152 _version: MavlinkVersion,
29153 __input: &[u8],
29154 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29155 let avail_len = __input.len();
29156 let mut payload_buf = [0; Self::ENCODED_LEN];
29157 let mut buf = if avail_len < Self::ENCODED_LEN {
29158 payload_buf[0..avail_len].copy_from_slice(__input);
29159 Bytes::new(&payload_buf)
29160 } else {
29161 Bytes::new(__input)
29162 };
29163 let mut __struct = Self::default();
29164 __struct.time_boot_ms = buf.get_u32_le();
29165 __struct.total_capacity = buf.get_f32_le();
29166 __struct.used_capacity = buf.get_f32_le();
29167 __struct.available_capacity = buf.get_f32_le();
29168 __struct.read_speed = buf.get_f32_le();
29169 __struct.write_speed = buf.get_f32_le();
29170 __struct.storage_id = buf.get_u8();
29171 __struct.storage_count = buf.get_u8();
29172 let tmp = buf.get_u8();
29173 __struct.status =
29174 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29175 enum_type: "StorageStatus",
29176 value: tmp as u64,
29177 })?;
29178 let tmp = buf.get_u8();
29179 __struct.mavtype =
29180 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29181 enum_type: "StorageType",
29182 value: tmp as u64,
29183 })?;
29184 let mut tmp = [0_u8; 32usize];
29185 for v in &mut tmp {
29186 *v = buf.get_u8();
29187 }
29188 __struct.name = CharArray::new(tmp);
29189 let tmp = buf.get_u8();
29190 __struct.storage_usage = StorageUsageFlag::from_bits(tmp).ok_or(
29191 ::mavlink_core::error::ParserError::InvalidFlag {
29192 flag_type: "StorageUsageFlag",
29193 value: tmp as u64,
29194 },
29195 )?;
29196 Ok(__struct)
29197 }
29198 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29199 let mut __tmp = BytesMut::new(bytes);
29200 #[allow(clippy::absurd_extreme_comparisons)]
29201 #[allow(unused_comparisons)]
29202 if __tmp.remaining() < Self::ENCODED_LEN {
29203 panic!(
29204 "buffer is too small (need {} bytes, but got {})",
29205 Self::ENCODED_LEN,
29206 __tmp.remaining(),
29207 )
29208 }
29209 __tmp.put_u32_le(self.time_boot_ms);
29210 __tmp.put_f32_le(self.total_capacity);
29211 __tmp.put_f32_le(self.used_capacity);
29212 __tmp.put_f32_le(self.available_capacity);
29213 __tmp.put_f32_le(self.read_speed);
29214 __tmp.put_f32_le(self.write_speed);
29215 __tmp.put_u8(self.storage_id);
29216 __tmp.put_u8(self.storage_count);
29217 __tmp.put_u8(self.status as u8);
29218 if matches!(version, MavlinkVersion::V2) {
29219 __tmp.put_u8(self.mavtype as u8);
29220 for val in &self.name {
29221 __tmp.put_u8(*val);
29222 }
29223 __tmp.put_u8(self.storage_usage.bits());
29224 let len = __tmp.len();
29225 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29226 } else {
29227 __tmp.len()
29228 }
29229 }
29230}
29231#[doc = "Tune formats supported by vehicle. This should be emitted as response to MAV_CMD_REQUEST_MESSAGE."]
29232#[doc = ""]
29233#[doc = "ID: 401"]
29234#[derive(Debug, Clone, PartialEq)]
29235#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29236#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29237#[cfg_attr(feature = "ts", derive(TS))]
29238#[cfg_attr(feature = "ts", ts(export))]
29239pub struct SUPPORTED_TUNES_DATA {
29240 #[doc = "Bitfield of supported tune formats."]
29241 pub format: TuneFormat,
29242 #[doc = "System ID"]
29243 pub target_system: u8,
29244 #[doc = "Component ID"]
29245 pub target_component: u8,
29246}
29247impl SUPPORTED_TUNES_DATA {
29248 pub const ENCODED_LEN: usize = 6usize;
29249 pub const DEFAULT: Self = Self {
29250 format: TuneFormat::DEFAULT,
29251 target_system: 0_u8,
29252 target_component: 0_u8,
29253 };
29254 #[cfg(feature = "arbitrary")]
29255 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29256 use arbitrary::{Arbitrary, Unstructured};
29257 let mut buf = [0u8; 1024];
29258 rng.fill_bytes(&mut buf);
29259 let mut unstructured = Unstructured::new(&buf);
29260 Self::arbitrary(&mut unstructured).unwrap_or_default()
29261 }
29262}
29263impl Default for SUPPORTED_TUNES_DATA {
29264 fn default() -> Self {
29265 Self::DEFAULT.clone()
29266 }
29267}
29268impl MessageData for SUPPORTED_TUNES_DATA {
29269 type Message = MavMessage;
29270 const ID: u32 = 401u32;
29271 const NAME: &'static str = "SUPPORTED_TUNES";
29272 const EXTRA_CRC: u8 = 183u8;
29273 const ENCODED_LEN: usize = 6usize;
29274 fn deser(
29275 _version: MavlinkVersion,
29276 __input: &[u8],
29277 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29278 let avail_len = __input.len();
29279 let mut payload_buf = [0; Self::ENCODED_LEN];
29280 let mut buf = if avail_len < Self::ENCODED_LEN {
29281 payload_buf[0..avail_len].copy_from_slice(__input);
29282 Bytes::new(&payload_buf)
29283 } else {
29284 Bytes::new(__input)
29285 };
29286 let mut __struct = Self::default();
29287 let tmp = buf.get_u32_le();
29288 __struct.format = FromPrimitive::from_u32(tmp).ok_or(
29289 ::mavlink_core::error::ParserError::InvalidEnum {
29290 enum_type: "TuneFormat",
29291 value: tmp as u64,
29292 },
29293 )?;
29294 __struct.target_system = buf.get_u8();
29295 __struct.target_component = buf.get_u8();
29296 Ok(__struct)
29297 }
29298 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29299 let mut __tmp = BytesMut::new(bytes);
29300 #[allow(clippy::absurd_extreme_comparisons)]
29301 #[allow(unused_comparisons)]
29302 if __tmp.remaining() < Self::ENCODED_LEN {
29303 panic!(
29304 "buffer is too small (need {} bytes, but got {})",
29305 Self::ENCODED_LEN,
29306 __tmp.remaining(),
29307 )
29308 }
29309 __tmp.put_u32_le(self.format as u32);
29310 __tmp.put_u8(self.target_system);
29311 __tmp.put_u8(self.target_component);
29312 if matches!(version, MavlinkVersion::V2) {
29313 let len = __tmp.len();
29314 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29315 } else {
29316 __tmp.len()
29317 }
29318 }
29319}
29320#[doc = "The system time is the time of the master clock. This can be emitted by flight controllers, onboard computers, or other components in the MAVLink network. Components that are using a less reliable time source, such as a battery-backed real time clock, can choose to match their system clock to that of a SYSTEM_TYPE that indicates a more recent time. This allows more broadly accurate date stamping of logs, and so on. If precise time synchronization is needed then use TIMESYNC instead."]
29321#[doc = ""]
29322#[doc = "ID: 2"]
29323#[derive(Debug, Clone, PartialEq)]
29324#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29325#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29326#[cfg_attr(feature = "ts", derive(TS))]
29327#[cfg_attr(feature = "ts", ts(export))]
29328pub struct SYSTEM_TIME_DATA {
29329 #[doc = "Timestamp (UNIX epoch time)."]
29330 pub time_unix_usec: u64,
29331 #[doc = "Timestamp (time since system boot)."]
29332 pub time_boot_ms: u32,
29333}
29334impl SYSTEM_TIME_DATA {
29335 pub const ENCODED_LEN: usize = 12usize;
29336 pub const DEFAULT: Self = Self {
29337 time_unix_usec: 0_u64,
29338 time_boot_ms: 0_u32,
29339 };
29340 #[cfg(feature = "arbitrary")]
29341 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29342 use arbitrary::{Arbitrary, Unstructured};
29343 let mut buf = [0u8; 1024];
29344 rng.fill_bytes(&mut buf);
29345 let mut unstructured = Unstructured::new(&buf);
29346 Self::arbitrary(&mut unstructured).unwrap_or_default()
29347 }
29348}
29349impl Default for SYSTEM_TIME_DATA {
29350 fn default() -> Self {
29351 Self::DEFAULT.clone()
29352 }
29353}
29354impl MessageData for SYSTEM_TIME_DATA {
29355 type Message = MavMessage;
29356 const ID: u32 = 2u32;
29357 const NAME: &'static str = "SYSTEM_TIME";
29358 const EXTRA_CRC: u8 = 137u8;
29359 const ENCODED_LEN: usize = 12usize;
29360 fn deser(
29361 _version: MavlinkVersion,
29362 __input: &[u8],
29363 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29364 let avail_len = __input.len();
29365 let mut payload_buf = [0; Self::ENCODED_LEN];
29366 let mut buf = if avail_len < Self::ENCODED_LEN {
29367 payload_buf[0..avail_len].copy_from_slice(__input);
29368 Bytes::new(&payload_buf)
29369 } else {
29370 Bytes::new(__input)
29371 };
29372 let mut __struct = Self::default();
29373 __struct.time_unix_usec = buf.get_u64_le();
29374 __struct.time_boot_ms = buf.get_u32_le();
29375 Ok(__struct)
29376 }
29377 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29378 let mut __tmp = BytesMut::new(bytes);
29379 #[allow(clippy::absurd_extreme_comparisons)]
29380 #[allow(unused_comparisons)]
29381 if __tmp.remaining() < Self::ENCODED_LEN {
29382 panic!(
29383 "buffer is too small (need {} bytes, but got {})",
29384 Self::ENCODED_LEN,
29385 __tmp.remaining(),
29386 )
29387 }
29388 __tmp.put_u64_le(self.time_unix_usec);
29389 __tmp.put_u32_le(self.time_boot_ms);
29390 if matches!(version, MavlinkVersion::V2) {
29391 let len = __tmp.len();
29392 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29393 } else {
29394 __tmp.len()
29395 }
29396 }
29397}
29398#[doc = "The general system state. If the system is following the MAVLink standard, the system state is mainly defined by three orthogonal states/modes: The system mode, which is either LOCKED (motors shut down and locked), MANUAL (system under RC control), GUIDED (system with autonomous position control, position setpoint controlled manually) or AUTO (system guided by path/waypoint planner). The NAV_MODE defined the current flight state: LIFTOFF (often an open-loop maneuver), LANDING, WAYPOINTS or VECTOR. This represents the internal navigation state machine. The system status shows whether the system is currently active or not and if an emergency occurred. During the CRITICAL and EMERGENCY states the MAV is still considered to be active, but should start emergency procedures autonomously. After a failure occurred it should first move from active to critical to allow manual intervention and then move to emergency after a certain timeout."]
29399#[doc = ""]
29400#[doc = "ID: 1"]
29401#[derive(Debug, Clone, PartialEq)]
29402#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29403#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29404#[cfg_attr(feature = "ts", derive(TS))]
29405#[cfg_attr(feature = "ts", ts(export))]
29406pub struct SYS_STATUS_DATA {
29407 #[doc = "Bitmap showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present."]
29408 pub onboard_control_sensors_present: MavSysStatusSensor,
29409 #[doc = "Bitmap showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled."]
29410 pub onboard_control_sensors_enabled: MavSysStatusSensor,
29411 #[doc = "Bitmap showing which onboard controllers and sensors have an error (or are operational). Value of 0: error. Value of 1: healthy."]
29412 pub onboard_control_sensors_health: MavSysStatusSensor,
29413 #[doc = "Maximum usage in percent of the mainloop time. Values: [0-1000] - should always be below 1000"]
29414 pub load: u16,
29415 #[doc = "Battery voltage, UINT16_MAX: Voltage not sent by autopilot"]
29416 pub voltage_battery: u16,
29417 #[doc = "Battery current, -1: Current not sent by autopilot"]
29418 pub current_battery: i16,
29419 #[doc = "Communication drop rate, (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)"]
29420 pub drop_rate_comm: u16,
29421 #[doc = "Communication errors (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)"]
29422 pub errors_comm: u16,
29423 #[doc = "Autopilot-specific errors"]
29424 pub errors_count1: u16,
29425 #[doc = "Autopilot-specific errors"]
29426 pub errors_count2: u16,
29427 #[doc = "Autopilot-specific errors"]
29428 pub errors_count3: u16,
29429 #[doc = "Autopilot-specific errors"]
29430 pub errors_count4: u16,
29431 #[doc = "Battery energy remaining, -1: Battery remaining energy not sent by autopilot"]
29432 pub battery_remaining: i8,
29433 #[doc = "Bitmap showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present."]
29434 #[cfg_attr(feature = "serde", serde(default))]
29435 pub onboard_control_sensors_present_extended: MavSysStatusSensorExtended,
29436 #[doc = "Bitmap showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled."]
29437 #[cfg_attr(feature = "serde", serde(default))]
29438 pub onboard_control_sensors_enabled_extended: MavSysStatusSensorExtended,
29439 #[doc = "Bitmap showing which onboard controllers and sensors have an error (or are operational). Value of 0: error. Value of 1: healthy."]
29440 #[cfg_attr(feature = "serde", serde(default))]
29441 pub onboard_control_sensors_health_extended: MavSysStatusSensorExtended,
29442}
29443impl SYS_STATUS_DATA {
29444 pub const ENCODED_LEN: usize = 43usize;
29445 pub const DEFAULT: Self = Self {
29446 onboard_control_sensors_present: MavSysStatusSensor::DEFAULT,
29447 onboard_control_sensors_enabled: MavSysStatusSensor::DEFAULT,
29448 onboard_control_sensors_health: MavSysStatusSensor::DEFAULT,
29449 load: 0_u16,
29450 voltage_battery: 0_u16,
29451 current_battery: 0_i16,
29452 drop_rate_comm: 0_u16,
29453 errors_comm: 0_u16,
29454 errors_count1: 0_u16,
29455 errors_count2: 0_u16,
29456 errors_count3: 0_u16,
29457 errors_count4: 0_u16,
29458 battery_remaining: 0_i8,
29459 onboard_control_sensors_present_extended: MavSysStatusSensorExtended::DEFAULT,
29460 onboard_control_sensors_enabled_extended: MavSysStatusSensorExtended::DEFAULT,
29461 onboard_control_sensors_health_extended: MavSysStatusSensorExtended::DEFAULT,
29462 };
29463 #[cfg(feature = "arbitrary")]
29464 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29465 use arbitrary::{Arbitrary, Unstructured};
29466 let mut buf = [0u8; 1024];
29467 rng.fill_bytes(&mut buf);
29468 let mut unstructured = Unstructured::new(&buf);
29469 Self::arbitrary(&mut unstructured).unwrap_or_default()
29470 }
29471}
29472impl Default for SYS_STATUS_DATA {
29473 fn default() -> Self {
29474 Self::DEFAULT.clone()
29475 }
29476}
29477impl MessageData for SYS_STATUS_DATA {
29478 type Message = MavMessage;
29479 const ID: u32 = 1u32;
29480 const NAME: &'static str = "SYS_STATUS";
29481 const EXTRA_CRC: u8 = 124u8;
29482 const ENCODED_LEN: usize = 43usize;
29483 fn deser(
29484 _version: MavlinkVersion,
29485 __input: &[u8],
29486 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29487 let avail_len = __input.len();
29488 let mut payload_buf = [0; Self::ENCODED_LEN];
29489 let mut buf = if avail_len < Self::ENCODED_LEN {
29490 payload_buf[0..avail_len].copy_from_slice(__input);
29491 Bytes::new(&payload_buf)
29492 } else {
29493 Bytes::new(__input)
29494 };
29495 let mut __struct = Self::default();
29496 let tmp = buf.get_u32_le();
29497 __struct.onboard_control_sensors_present = MavSysStatusSensor::from_bits(tmp).ok_or(
29498 ::mavlink_core::error::ParserError::InvalidFlag {
29499 flag_type: "MavSysStatusSensor",
29500 value: tmp as u64,
29501 },
29502 )?;
29503 let tmp = buf.get_u32_le();
29504 __struct.onboard_control_sensors_enabled = MavSysStatusSensor::from_bits(tmp).ok_or(
29505 ::mavlink_core::error::ParserError::InvalidFlag {
29506 flag_type: "MavSysStatusSensor",
29507 value: tmp as u64,
29508 },
29509 )?;
29510 let tmp = buf.get_u32_le();
29511 __struct.onboard_control_sensors_health = MavSysStatusSensor::from_bits(tmp).ok_or(
29512 ::mavlink_core::error::ParserError::InvalidFlag {
29513 flag_type: "MavSysStatusSensor",
29514 value: tmp as u64,
29515 },
29516 )?;
29517 __struct.load = buf.get_u16_le();
29518 __struct.voltage_battery = buf.get_u16_le();
29519 __struct.current_battery = buf.get_i16_le();
29520 __struct.drop_rate_comm = buf.get_u16_le();
29521 __struct.errors_comm = buf.get_u16_le();
29522 __struct.errors_count1 = buf.get_u16_le();
29523 __struct.errors_count2 = buf.get_u16_le();
29524 __struct.errors_count3 = buf.get_u16_le();
29525 __struct.errors_count4 = buf.get_u16_le();
29526 __struct.battery_remaining = buf.get_i8();
29527 let tmp = buf.get_u32_le();
29528 __struct.onboard_control_sensors_present_extended = MavSysStatusSensorExtended::from_bits(
29529 tmp,
29530 )
29531 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29532 flag_type: "MavSysStatusSensorExtended",
29533 value: tmp as u64,
29534 })?;
29535 let tmp = buf.get_u32_le();
29536 __struct.onboard_control_sensors_enabled_extended = MavSysStatusSensorExtended::from_bits(
29537 tmp,
29538 )
29539 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29540 flag_type: "MavSysStatusSensorExtended",
29541 value: tmp as u64,
29542 })?;
29543 let tmp = buf.get_u32_le();
29544 __struct.onboard_control_sensors_health_extended = MavSysStatusSensorExtended::from_bits(
29545 tmp,
29546 )
29547 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29548 flag_type: "MavSysStatusSensorExtended",
29549 value: tmp as u64,
29550 })?;
29551 Ok(__struct)
29552 }
29553 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29554 let mut __tmp = BytesMut::new(bytes);
29555 #[allow(clippy::absurd_extreme_comparisons)]
29556 #[allow(unused_comparisons)]
29557 if __tmp.remaining() < Self::ENCODED_LEN {
29558 panic!(
29559 "buffer is too small (need {} bytes, but got {})",
29560 Self::ENCODED_LEN,
29561 __tmp.remaining(),
29562 )
29563 }
29564 __tmp.put_u32_le(self.onboard_control_sensors_present.bits());
29565 __tmp.put_u32_le(self.onboard_control_sensors_enabled.bits());
29566 __tmp.put_u32_le(self.onboard_control_sensors_health.bits());
29567 __tmp.put_u16_le(self.load);
29568 __tmp.put_u16_le(self.voltage_battery);
29569 __tmp.put_i16_le(self.current_battery);
29570 __tmp.put_u16_le(self.drop_rate_comm);
29571 __tmp.put_u16_le(self.errors_comm);
29572 __tmp.put_u16_le(self.errors_count1);
29573 __tmp.put_u16_le(self.errors_count2);
29574 __tmp.put_u16_le(self.errors_count3);
29575 __tmp.put_u16_le(self.errors_count4);
29576 __tmp.put_i8(self.battery_remaining);
29577 if matches!(version, MavlinkVersion::V2) {
29578 __tmp.put_u32_le(self.onboard_control_sensors_present_extended.bits());
29579 __tmp.put_u32_le(self.onboard_control_sensors_enabled_extended.bits());
29580 __tmp.put_u32_le(self.onboard_control_sensors_health_extended.bits());
29581 let len = __tmp.len();
29582 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29583 } else {
29584 __tmp.len()
29585 }
29586 }
29587}
29588#[doc = "Request that the vehicle report terrain height at the given location (expected response is a TERRAIN_REPORT). Used by GCS to check if vehicle has all terrain data needed for a mission."]
29589#[doc = ""]
29590#[doc = "ID: 135"]
29591#[derive(Debug, Clone, PartialEq)]
29592#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29593#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29594#[cfg_attr(feature = "ts", derive(TS))]
29595#[cfg_attr(feature = "ts", ts(export))]
29596pub struct TERRAIN_CHECK_DATA {
29597 #[doc = "Latitude"]
29598 pub lat: i32,
29599 #[doc = "Longitude"]
29600 pub lon: i32,
29601}
29602impl TERRAIN_CHECK_DATA {
29603 pub const ENCODED_LEN: usize = 8usize;
29604 pub const DEFAULT: Self = Self {
29605 lat: 0_i32,
29606 lon: 0_i32,
29607 };
29608 #[cfg(feature = "arbitrary")]
29609 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29610 use arbitrary::{Arbitrary, Unstructured};
29611 let mut buf = [0u8; 1024];
29612 rng.fill_bytes(&mut buf);
29613 let mut unstructured = Unstructured::new(&buf);
29614 Self::arbitrary(&mut unstructured).unwrap_or_default()
29615 }
29616}
29617impl Default for TERRAIN_CHECK_DATA {
29618 fn default() -> Self {
29619 Self::DEFAULT.clone()
29620 }
29621}
29622impl MessageData for TERRAIN_CHECK_DATA {
29623 type Message = MavMessage;
29624 const ID: u32 = 135u32;
29625 const NAME: &'static str = "TERRAIN_CHECK";
29626 const EXTRA_CRC: u8 = 203u8;
29627 const ENCODED_LEN: usize = 8usize;
29628 fn deser(
29629 _version: MavlinkVersion,
29630 __input: &[u8],
29631 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29632 let avail_len = __input.len();
29633 let mut payload_buf = [0; Self::ENCODED_LEN];
29634 let mut buf = if avail_len < Self::ENCODED_LEN {
29635 payload_buf[0..avail_len].copy_from_slice(__input);
29636 Bytes::new(&payload_buf)
29637 } else {
29638 Bytes::new(__input)
29639 };
29640 let mut __struct = Self::default();
29641 __struct.lat = buf.get_i32_le();
29642 __struct.lon = buf.get_i32_le();
29643 Ok(__struct)
29644 }
29645 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29646 let mut __tmp = BytesMut::new(bytes);
29647 #[allow(clippy::absurd_extreme_comparisons)]
29648 #[allow(unused_comparisons)]
29649 if __tmp.remaining() < Self::ENCODED_LEN {
29650 panic!(
29651 "buffer is too small (need {} bytes, but got {})",
29652 Self::ENCODED_LEN,
29653 __tmp.remaining(),
29654 )
29655 }
29656 __tmp.put_i32_le(self.lat);
29657 __tmp.put_i32_le(self.lon);
29658 if matches!(version, MavlinkVersion::V2) {
29659 let len = __tmp.len();
29660 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29661 } else {
29662 __tmp.len()
29663 }
29664 }
29665}
29666#[doc = "Terrain data sent from GCS. The lat/lon and grid_spacing must be the same as a lat/lon from a TERRAIN_REQUEST. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
29667#[doc = ""]
29668#[doc = "ID: 134"]
29669#[derive(Debug, Clone, PartialEq)]
29670#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29671#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29672#[cfg_attr(feature = "ts", derive(TS))]
29673#[cfg_attr(feature = "ts", ts(export))]
29674pub struct TERRAIN_DATA_DATA {
29675 #[doc = "Latitude of SW corner of first grid"]
29676 pub lat: i32,
29677 #[doc = "Longitude of SW corner of first grid"]
29678 pub lon: i32,
29679 #[doc = "Grid spacing"]
29680 pub grid_spacing: u16,
29681 #[doc = "Terrain data MSL"]
29682 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29683 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
29684 pub data: [i16; 16],
29685 #[doc = "bit within the terrain request mask"]
29686 pub gridbit: u8,
29687}
29688impl TERRAIN_DATA_DATA {
29689 pub const ENCODED_LEN: usize = 43usize;
29690 pub const DEFAULT: Self = Self {
29691 lat: 0_i32,
29692 lon: 0_i32,
29693 grid_spacing: 0_u16,
29694 data: [0_i16; 16usize],
29695 gridbit: 0_u8,
29696 };
29697 #[cfg(feature = "arbitrary")]
29698 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29699 use arbitrary::{Arbitrary, Unstructured};
29700 let mut buf = [0u8; 1024];
29701 rng.fill_bytes(&mut buf);
29702 let mut unstructured = Unstructured::new(&buf);
29703 Self::arbitrary(&mut unstructured).unwrap_or_default()
29704 }
29705}
29706impl Default for TERRAIN_DATA_DATA {
29707 fn default() -> Self {
29708 Self::DEFAULT.clone()
29709 }
29710}
29711impl MessageData for TERRAIN_DATA_DATA {
29712 type Message = MavMessage;
29713 const ID: u32 = 134u32;
29714 const NAME: &'static str = "TERRAIN_DATA";
29715 const EXTRA_CRC: u8 = 229u8;
29716 const ENCODED_LEN: usize = 43usize;
29717 fn deser(
29718 _version: MavlinkVersion,
29719 __input: &[u8],
29720 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29721 let avail_len = __input.len();
29722 let mut payload_buf = [0; Self::ENCODED_LEN];
29723 let mut buf = if avail_len < Self::ENCODED_LEN {
29724 payload_buf[0..avail_len].copy_from_slice(__input);
29725 Bytes::new(&payload_buf)
29726 } else {
29727 Bytes::new(__input)
29728 };
29729 let mut __struct = Self::default();
29730 __struct.lat = buf.get_i32_le();
29731 __struct.lon = buf.get_i32_le();
29732 __struct.grid_spacing = buf.get_u16_le();
29733 for v in &mut __struct.data {
29734 let val = buf.get_i16_le();
29735 *v = val;
29736 }
29737 __struct.gridbit = buf.get_u8();
29738 Ok(__struct)
29739 }
29740 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29741 let mut __tmp = BytesMut::new(bytes);
29742 #[allow(clippy::absurd_extreme_comparisons)]
29743 #[allow(unused_comparisons)]
29744 if __tmp.remaining() < Self::ENCODED_LEN {
29745 panic!(
29746 "buffer is too small (need {} bytes, but got {})",
29747 Self::ENCODED_LEN,
29748 __tmp.remaining(),
29749 )
29750 }
29751 __tmp.put_i32_le(self.lat);
29752 __tmp.put_i32_le(self.lon);
29753 __tmp.put_u16_le(self.grid_spacing);
29754 for val in &self.data {
29755 __tmp.put_i16_le(*val);
29756 }
29757 __tmp.put_u8(self.gridbit);
29758 if matches!(version, MavlinkVersion::V2) {
29759 let len = __tmp.len();
29760 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29761 } else {
29762 __tmp.len()
29763 }
29764 }
29765}
29766#[doc = "Streamed from drone to report progress of terrain map download (initiated by TERRAIN_REQUEST), or sent as a response to a TERRAIN_CHECK request. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
29767#[doc = ""]
29768#[doc = "ID: 136"]
29769#[derive(Debug, Clone, PartialEq)]
29770#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29771#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29772#[cfg_attr(feature = "ts", derive(TS))]
29773#[cfg_attr(feature = "ts", ts(export))]
29774pub struct TERRAIN_REPORT_DATA {
29775 #[doc = "Latitude"]
29776 pub lat: i32,
29777 #[doc = "Longitude"]
29778 pub lon: i32,
29779 #[doc = "Terrain height MSL"]
29780 pub terrain_height: f32,
29781 #[doc = "Current vehicle height above lat/lon terrain height"]
29782 pub current_height: f32,
29783 #[doc = "grid spacing (zero if terrain at this location unavailable)"]
29784 pub spacing: u16,
29785 #[doc = "Number of 4x4 terrain blocks waiting to be received or read from disk"]
29786 pub pending: u16,
29787 #[doc = "Number of 4x4 terrain blocks in memory"]
29788 pub loaded: u16,
29789}
29790impl TERRAIN_REPORT_DATA {
29791 pub const ENCODED_LEN: usize = 22usize;
29792 pub const DEFAULT: Self = Self {
29793 lat: 0_i32,
29794 lon: 0_i32,
29795 terrain_height: 0.0_f32,
29796 current_height: 0.0_f32,
29797 spacing: 0_u16,
29798 pending: 0_u16,
29799 loaded: 0_u16,
29800 };
29801 #[cfg(feature = "arbitrary")]
29802 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29803 use arbitrary::{Arbitrary, Unstructured};
29804 let mut buf = [0u8; 1024];
29805 rng.fill_bytes(&mut buf);
29806 let mut unstructured = Unstructured::new(&buf);
29807 Self::arbitrary(&mut unstructured).unwrap_or_default()
29808 }
29809}
29810impl Default for TERRAIN_REPORT_DATA {
29811 fn default() -> Self {
29812 Self::DEFAULT.clone()
29813 }
29814}
29815impl MessageData for TERRAIN_REPORT_DATA {
29816 type Message = MavMessage;
29817 const ID: u32 = 136u32;
29818 const NAME: &'static str = "TERRAIN_REPORT";
29819 const EXTRA_CRC: u8 = 1u8;
29820 const ENCODED_LEN: usize = 22usize;
29821 fn deser(
29822 _version: MavlinkVersion,
29823 __input: &[u8],
29824 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29825 let avail_len = __input.len();
29826 let mut payload_buf = [0; Self::ENCODED_LEN];
29827 let mut buf = if avail_len < Self::ENCODED_LEN {
29828 payload_buf[0..avail_len].copy_from_slice(__input);
29829 Bytes::new(&payload_buf)
29830 } else {
29831 Bytes::new(__input)
29832 };
29833 let mut __struct = Self::default();
29834 __struct.lat = buf.get_i32_le();
29835 __struct.lon = buf.get_i32_le();
29836 __struct.terrain_height = buf.get_f32_le();
29837 __struct.current_height = buf.get_f32_le();
29838 __struct.spacing = buf.get_u16_le();
29839 __struct.pending = buf.get_u16_le();
29840 __struct.loaded = buf.get_u16_le();
29841 Ok(__struct)
29842 }
29843 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29844 let mut __tmp = BytesMut::new(bytes);
29845 #[allow(clippy::absurd_extreme_comparisons)]
29846 #[allow(unused_comparisons)]
29847 if __tmp.remaining() < Self::ENCODED_LEN {
29848 panic!(
29849 "buffer is too small (need {} bytes, but got {})",
29850 Self::ENCODED_LEN,
29851 __tmp.remaining(),
29852 )
29853 }
29854 __tmp.put_i32_le(self.lat);
29855 __tmp.put_i32_le(self.lon);
29856 __tmp.put_f32_le(self.terrain_height);
29857 __tmp.put_f32_le(self.current_height);
29858 __tmp.put_u16_le(self.spacing);
29859 __tmp.put_u16_le(self.pending);
29860 __tmp.put_u16_le(self.loaded);
29861 if matches!(version, MavlinkVersion::V2) {
29862 let len = __tmp.len();
29863 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29864 } else {
29865 __tmp.len()
29866 }
29867 }
29868}
29869#[doc = "Request for terrain data and terrain status. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
29870#[doc = ""]
29871#[doc = "ID: 133"]
29872#[derive(Debug, Clone, PartialEq)]
29873#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29874#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29875#[cfg_attr(feature = "ts", derive(TS))]
29876#[cfg_attr(feature = "ts", ts(export))]
29877pub struct TERRAIN_REQUEST_DATA {
29878 #[doc = "Bitmask of requested 4x4 grids (row major 8x7 array of grids, 56 bits)"]
29879 pub mask: u64,
29880 #[doc = "Latitude of SW corner of first grid"]
29881 pub lat: i32,
29882 #[doc = "Longitude of SW corner of first grid"]
29883 pub lon: i32,
29884 #[doc = "Grid spacing"]
29885 pub grid_spacing: u16,
29886}
29887impl TERRAIN_REQUEST_DATA {
29888 pub const ENCODED_LEN: usize = 18usize;
29889 pub const DEFAULT: Self = Self {
29890 mask: 0_u64,
29891 lat: 0_i32,
29892 lon: 0_i32,
29893 grid_spacing: 0_u16,
29894 };
29895 #[cfg(feature = "arbitrary")]
29896 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29897 use arbitrary::{Arbitrary, Unstructured};
29898 let mut buf = [0u8; 1024];
29899 rng.fill_bytes(&mut buf);
29900 let mut unstructured = Unstructured::new(&buf);
29901 Self::arbitrary(&mut unstructured).unwrap_or_default()
29902 }
29903}
29904impl Default for TERRAIN_REQUEST_DATA {
29905 fn default() -> Self {
29906 Self::DEFAULT.clone()
29907 }
29908}
29909impl MessageData for TERRAIN_REQUEST_DATA {
29910 type Message = MavMessage;
29911 const ID: u32 = 133u32;
29912 const NAME: &'static str = "TERRAIN_REQUEST";
29913 const EXTRA_CRC: u8 = 6u8;
29914 const ENCODED_LEN: usize = 18usize;
29915 fn deser(
29916 _version: MavlinkVersion,
29917 __input: &[u8],
29918 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29919 let avail_len = __input.len();
29920 let mut payload_buf = [0; Self::ENCODED_LEN];
29921 let mut buf = if avail_len < Self::ENCODED_LEN {
29922 payload_buf[0..avail_len].copy_from_slice(__input);
29923 Bytes::new(&payload_buf)
29924 } else {
29925 Bytes::new(__input)
29926 };
29927 let mut __struct = Self::default();
29928 __struct.mask = buf.get_u64_le();
29929 __struct.lat = buf.get_i32_le();
29930 __struct.lon = buf.get_i32_le();
29931 __struct.grid_spacing = buf.get_u16_le();
29932 Ok(__struct)
29933 }
29934 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29935 let mut __tmp = BytesMut::new(bytes);
29936 #[allow(clippy::absurd_extreme_comparisons)]
29937 #[allow(unused_comparisons)]
29938 if __tmp.remaining() < Self::ENCODED_LEN {
29939 panic!(
29940 "buffer is too small (need {} bytes, but got {})",
29941 Self::ENCODED_LEN,
29942 __tmp.remaining(),
29943 )
29944 }
29945 __tmp.put_u64_le(self.mask);
29946 __tmp.put_i32_le(self.lat);
29947 __tmp.put_i32_le(self.lon);
29948 __tmp.put_u16_le(self.grid_spacing);
29949 if matches!(version, MavlinkVersion::V2) {
29950 let len = __tmp.len();
29951 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29952 } else {
29953 __tmp.len()
29954 }
29955 }
29956}
29957#[doc = "Time synchronization message. The message is used for both timesync requests and responses. The request is sent with `ts1=syncing component timestamp` and `tc1=0`, and may be broadcast or targeted to a specific system/component. The response is sent with `ts1=syncing component timestamp` (mirror back unchanged), and `tc1=responding component timestamp`, with the `target_system` and `target_component` set to ids of the original request. Systems can determine if they are receiving a request or response based on the value of `tc`. If the response has `target_system==target_component==0` the remote system has not been updated to use the component IDs and cannot reliably timesync; the requestor may report an error. Timestamps are UNIX Epoch time or time since system boot in nanoseconds (the timestamp format can be inferred by checking for the magnitude of the number; generally it doesn't matter as only the offset is used). The message sequence is repeated numerous times with results being filtered/averaged to estimate the offset. See also: <https://mavlink.io/en/services/timesync.html>."]
29958#[doc = ""]
29959#[doc = "ID: 111"]
29960#[derive(Debug, Clone, PartialEq)]
29961#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29962#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29963#[cfg_attr(feature = "ts", derive(TS))]
29964#[cfg_attr(feature = "ts", ts(export))]
29965pub struct TIMESYNC_DATA {
29966 #[doc = "Time sync timestamp 1. Syncing: 0. Responding: Timestamp of responding component."]
29967 pub tc1: i64,
29968 #[doc = "Time sync timestamp 2. Timestamp of syncing component (mirrored in response)."]
29969 pub ts1: i64,
29970 #[doc = "Target system id. Request: 0 (broadcast) or id of specific system. Response must contain system id of the requesting component."]
29971 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29972 pub target_system: u8,
29973 #[doc = "Target component id. Request: 0 (broadcast) or id of specific component. Response must contain component id of the requesting component."]
29974 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29975 pub target_component: u8,
29976}
29977impl TIMESYNC_DATA {
29978 pub const ENCODED_LEN: usize = 18usize;
29979 pub const DEFAULT: Self = Self {
29980 tc1: 0_i64,
29981 ts1: 0_i64,
29982 target_system: 0_u8,
29983 target_component: 0_u8,
29984 };
29985 #[cfg(feature = "arbitrary")]
29986 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29987 use arbitrary::{Arbitrary, Unstructured};
29988 let mut buf = [0u8; 1024];
29989 rng.fill_bytes(&mut buf);
29990 let mut unstructured = Unstructured::new(&buf);
29991 Self::arbitrary(&mut unstructured).unwrap_or_default()
29992 }
29993}
29994impl Default for TIMESYNC_DATA {
29995 fn default() -> Self {
29996 Self::DEFAULT.clone()
29997 }
29998}
29999impl MessageData for TIMESYNC_DATA {
30000 type Message = MavMessage;
30001 const ID: u32 = 111u32;
30002 const NAME: &'static str = "TIMESYNC";
30003 const EXTRA_CRC: u8 = 34u8;
30004 const ENCODED_LEN: usize = 18usize;
30005 fn deser(
30006 _version: MavlinkVersion,
30007 __input: &[u8],
30008 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30009 let avail_len = __input.len();
30010 let mut payload_buf = [0; Self::ENCODED_LEN];
30011 let mut buf = if avail_len < Self::ENCODED_LEN {
30012 payload_buf[0..avail_len].copy_from_slice(__input);
30013 Bytes::new(&payload_buf)
30014 } else {
30015 Bytes::new(__input)
30016 };
30017 let mut __struct = Self::default();
30018 __struct.tc1 = buf.get_i64_le();
30019 __struct.ts1 = buf.get_i64_le();
30020 __struct.target_system = buf.get_u8();
30021 __struct.target_component = buf.get_u8();
30022 Ok(__struct)
30023 }
30024 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30025 let mut __tmp = BytesMut::new(bytes);
30026 #[allow(clippy::absurd_extreme_comparisons)]
30027 #[allow(unused_comparisons)]
30028 if __tmp.remaining() < Self::ENCODED_LEN {
30029 panic!(
30030 "buffer is too small (need {} bytes, but got {})",
30031 Self::ENCODED_LEN,
30032 __tmp.remaining(),
30033 )
30034 }
30035 __tmp.put_i64_le(self.tc1);
30036 __tmp.put_i64_le(self.ts1);
30037 if matches!(version, MavlinkVersion::V2) {
30038 __tmp.put_u8(self.target_system);
30039 __tmp.put_u8(self.target_component);
30040 let len = __tmp.len();
30041 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30042 } else {
30043 __tmp.len()
30044 }
30045 }
30046}
30047#[doc = "Time/duration estimates for various events and actions given the current vehicle state and position."]
30048#[doc = ""]
30049#[doc = "ID: 380"]
30050#[derive(Debug, Clone, PartialEq)]
30051#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30052#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30053#[cfg_attr(feature = "ts", derive(TS))]
30054#[cfg_attr(feature = "ts", ts(export))]
30055pub struct TIME_ESTIMATE_TO_TARGET_DATA {
30056 #[doc = "Estimated time to complete the vehicle's configured \"safe return\" action from its current position (e.g. RTL, Smart RTL, etc.). -1 indicates that the vehicle is landed, or that no time estimate available."]
30057 pub safe_return: i32,
30058 #[doc = "Estimated time for vehicle to complete the LAND action from its current position. -1 indicates that the vehicle is landed, or that no time estimate available."]
30059 pub land: i32,
30060 #[doc = "Estimated time for reaching/completing the currently active mission item. -1 means no time estimate available."]
30061 pub mission_next_item: i32,
30062 #[doc = "Estimated time for completing the current mission. -1 means no mission active and/or no estimate available."]
30063 pub mission_end: i32,
30064 #[doc = "Estimated time for completing the current commanded action (i.e. Go To, Takeoff, Land, etc.). -1 means no action active and/or no estimate available."]
30065 pub commanded_action: i32,
30066}
30067impl TIME_ESTIMATE_TO_TARGET_DATA {
30068 pub const ENCODED_LEN: usize = 20usize;
30069 pub const DEFAULT: Self = Self {
30070 safe_return: 0_i32,
30071 land: 0_i32,
30072 mission_next_item: 0_i32,
30073 mission_end: 0_i32,
30074 commanded_action: 0_i32,
30075 };
30076 #[cfg(feature = "arbitrary")]
30077 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30078 use arbitrary::{Arbitrary, Unstructured};
30079 let mut buf = [0u8; 1024];
30080 rng.fill_bytes(&mut buf);
30081 let mut unstructured = Unstructured::new(&buf);
30082 Self::arbitrary(&mut unstructured).unwrap_or_default()
30083 }
30084}
30085impl Default for TIME_ESTIMATE_TO_TARGET_DATA {
30086 fn default() -> Self {
30087 Self::DEFAULT.clone()
30088 }
30089}
30090impl MessageData for TIME_ESTIMATE_TO_TARGET_DATA {
30091 type Message = MavMessage;
30092 const ID: u32 = 380u32;
30093 const NAME: &'static str = "TIME_ESTIMATE_TO_TARGET";
30094 const EXTRA_CRC: u8 = 232u8;
30095 const ENCODED_LEN: usize = 20usize;
30096 fn deser(
30097 _version: MavlinkVersion,
30098 __input: &[u8],
30099 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30100 let avail_len = __input.len();
30101 let mut payload_buf = [0; Self::ENCODED_LEN];
30102 let mut buf = if avail_len < Self::ENCODED_LEN {
30103 payload_buf[0..avail_len].copy_from_slice(__input);
30104 Bytes::new(&payload_buf)
30105 } else {
30106 Bytes::new(__input)
30107 };
30108 let mut __struct = Self::default();
30109 __struct.safe_return = buf.get_i32_le();
30110 __struct.land = buf.get_i32_le();
30111 __struct.mission_next_item = buf.get_i32_le();
30112 __struct.mission_end = buf.get_i32_le();
30113 __struct.commanded_action = buf.get_i32_le();
30114 Ok(__struct)
30115 }
30116 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30117 let mut __tmp = BytesMut::new(bytes);
30118 #[allow(clippy::absurd_extreme_comparisons)]
30119 #[allow(unused_comparisons)]
30120 if __tmp.remaining() < Self::ENCODED_LEN {
30121 panic!(
30122 "buffer is too small (need {} bytes, but got {})",
30123 Self::ENCODED_LEN,
30124 __tmp.remaining(),
30125 )
30126 }
30127 __tmp.put_i32_le(self.safe_return);
30128 __tmp.put_i32_le(self.land);
30129 __tmp.put_i32_le(self.mission_next_item);
30130 __tmp.put_i32_le(self.mission_end);
30131 __tmp.put_i32_le(self.commanded_action);
30132 if matches!(version, MavlinkVersion::V2) {
30133 let len = __tmp.len();
30134 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30135 } else {
30136 __tmp.len()
30137 }
30138 }
30139}
30140#[doc = "Describe a trajectory using an array of up-to 5 bezier control points in the local frame (MAV_FRAME_LOCAL_NED)."]
30141#[doc = ""]
30142#[doc = "ID: 333"]
30143#[derive(Debug, Clone, PartialEq)]
30144#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30145#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30146#[cfg_attr(feature = "ts", derive(TS))]
30147#[cfg_attr(feature = "ts", ts(export))]
30148pub struct TRAJECTORY_REPRESENTATION_BEZIER_DATA {
30149 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
30150 pub time_usec: u64,
30151 #[doc = "X-coordinate of bezier control points. Set to NaN if not being used"]
30152 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30153 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30154 pub pos_x: [f32; 5],
30155 #[doc = "Y-coordinate of bezier control points. Set to NaN if not being used"]
30156 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30157 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30158 pub pos_y: [f32; 5],
30159 #[doc = "Z-coordinate of bezier control points. Set to NaN if not being used"]
30160 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30161 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30162 pub pos_z: [f32; 5],
30163 #[doc = "Bezier time horizon. Set to NaN if velocity/acceleration should not be incorporated"]
30164 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30165 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30166 pub delta: [f32; 5],
30167 #[doc = "Yaw. Set to NaN for unchanged"]
30168 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30169 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30170 pub pos_yaw: [f32; 5],
30171 #[doc = "Number of valid control points (up-to 5 points are possible)"]
30172 pub valid_points: u8,
30173}
30174impl TRAJECTORY_REPRESENTATION_BEZIER_DATA {
30175 pub const ENCODED_LEN: usize = 109usize;
30176 pub const DEFAULT: Self = Self {
30177 time_usec: 0_u64,
30178 pos_x: [0.0_f32; 5usize],
30179 pos_y: [0.0_f32; 5usize],
30180 pos_z: [0.0_f32; 5usize],
30181 delta: [0.0_f32; 5usize],
30182 pos_yaw: [0.0_f32; 5usize],
30183 valid_points: 0_u8,
30184 };
30185 #[cfg(feature = "arbitrary")]
30186 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30187 use arbitrary::{Arbitrary, Unstructured};
30188 let mut buf = [0u8; 1024];
30189 rng.fill_bytes(&mut buf);
30190 let mut unstructured = Unstructured::new(&buf);
30191 Self::arbitrary(&mut unstructured).unwrap_or_default()
30192 }
30193}
30194impl Default for TRAJECTORY_REPRESENTATION_BEZIER_DATA {
30195 fn default() -> Self {
30196 Self::DEFAULT.clone()
30197 }
30198}
30199impl MessageData for TRAJECTORY_REPRESENTATION_BEZIER_DATA {
30200 type Message = MavMessage;
30201 const ID: u32 = 333u32;
30202 const NAME: &'static str = "TRAJECTORY_REPRESENTATION_BEZIER";
30203 const EXTRA_CRC: u8 = 231u8;
30204 const ENCODED_LEN: usize = 109usize;
30205 fn deser(
30206 _version: MavlinkVersion,
30207 __input: &[u8],
30208 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30209 let avail_len = __input.len();
30210 let mut payload_buf = [0; Self::ENCODED_LEN];
30211 let mut buf = if avail_len < Self::ENCODED_LEN {
30212 payload_buf[0..avail_len].copy_from_slice(__input);
30213 Bytes::new(&payload_buf)
30214 } else {
30215 Bytes::new(__input)
30216 };
30217 let mut __struct = Self::default();
30218 __struct.time_usec = buf.get_u64_le();
30219 for v in &mut __struct.pos_x {
30220 let val = buf.get_f32_le();
30221 *v = val;
30222 }
30223 for v in &mut __struct.pos_y {
30224 let val = buf.get_f32_le();
30225 *v = val;
30226 }
30227 for v in &mut __struct.pos_z {
30228 let val = buf.get_f32_le();
30229 *v = val;
30230 }
30231 for v in &mut __struct.delta {
30232 let val = buf.get_f32_le();
30233 *v = val;
30234 }
30235 for v in &mut __struct.pos_yaw {
30236 let val = buf.get_f32_le();
30237 *v = val;
30238 }
30239 __struct.valid_points = buf.get_u8();
30240 Ok(__struct)
30241 }
30242 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30243 let mut __tmp = BytesMut::new(bytes);
30244 #[allow(clippy::absurd_extreme_comparisons)]
30245 #[allow(unused_comparisons)]
30246 if __tmp.remaining() < Self::ENCODED_LEN {
30247 panic!(
30248 "buffer is too small (need {} bytes, but got {})",
30249 Self::ENCODED_LEN,
30250 __tmp.remaining(),
30251 )
30252 }
30253 __tmp.put_u64_le(self.time_usec);
30254 for val in &self.pos_x {
30255 __tmp.put_f32_le(*val);
30256 }
30257 for val in &self.pos_y {
30258 __tmp.put_f32_le(*val);
30259 }
30260 for val in &self.pos_z {
30261 __tmp.put_f32_le(*val);
30262 }
30263 for val in &self.delta {
30264 __tmp.put_f32_le(*val);
30265 }
30266 for val in &self.pos_yaw {
30267 __tmp.put_f32_le(*val);
30268 }
30269 __tmp.put_u8(self.valid_points);
30270 if matches!(version, MavlinkVersion::V2) {
30271 let len = __tmp.len();
30272 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30273 } else {
30274 __tmp.len()
30275 }
30276 }
30277}
30278#[doc = "Describe a trajectory using an array of up-to 5 waypoints in the local frame (MAV_FRAME_LOCAL_NED)."]
30279#[doc = ""]
30280#[doc = "ID: 332"]
30281#[derive(Debug, Clone, PartialEq)]
30282#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30283#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30284#[cfg_attr(feature = "ts", derive(TS))]
30285#[cfg_attr(feature = "ts", ts(export))]
30286pub struct TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
30287 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
30288 pub time_usec: u64,
30289 #[doc = "X-coordinate of waypoint, set to NaN if not being used"]
30290 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30291 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30292 pub pos_x: [f32; 5],
30293 #[doc = "Y-coordinate of waypoint, set to NaN if not being used"]
30294 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30295 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30296 pub pos_y: [f32; 5],
30297 #[doc = "Z-coordinate of waypoint, set to NaN if not being used"]
30298 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30299 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30300 pub pos_z: [f32; 5],
30301 #[doc = "X-velocity of waypoint, set to NaN if not being used"]
30302 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30303 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30304 pub vel_x: [f32; 5],
30305 #[doc = "Y-velocity of waypoint, set to NaN if not being used"]
30306 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30307 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30308 pub vel_y: [f32; 5],
30309 #[doc = "Z-velocity of waypoint, set to NaN if not being used"]
30310 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30311 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30312 pub vel_z: [f32; 5],
30313 #[doc = "X-acceleration of waypoint, set to NaN if not being used"]
30314 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30315 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30316 pub acc_x: [f32; 5],
30317 #[doc = "Y-acceleration of waypoint, set to NaN if not being used"]
30318 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30319 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30320 pub acc_y: [f32; 5],
30321 #[doc = "Z-acceleration of waypoint, set to NaN if not being used"]
30322 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30323 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30324 pub acc_z: [f32; 5],
30325 #[doc = "Yaw angle, set to NaN if not being used"]
30326 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30327 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30328 pub pos_yaw: [f32; 5],
30329 #[doc = "Yaw rate, set to NaN if not being used"]
30330 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30331 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30332 pub vel_yaw: [f32; 5],
30333 #[doc = "MAV_CMD command id of waypoint, set to UINT16_MAX if not being used."]
30334 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30335 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30336 pub command: [u16; 5],
30337 #[doc = "Number of valid points (up-to 5 waypoints are possible)"]
30338 pub valid_points: u8,
30339}
30340impl TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
30341 pub const ENCODED_LEN: usize = 239usize;
30342 pub const DEFAULT: Self = Self {
30343 time_usec: 0_u64,
30344 pos_x: [0.0_f32; 5usize],
30345 pos_y: [0.0_f32; 5usize],
30346 pos_z: [0.0_f32; 5usize],
30347 vel_x: [0.0_f32; 5usize],
30348 vel_y: [0.0_f32; 5usize],
30349 vel_z: [0.0_f32; 5usize],
30350 acc_x: [0.0_f32; 5usize],
30351 acc_y: [0.0_f32; 5usize],
30352 acc_z: [0.0_f32; 5usize],
30353 pos_yaw: [0.0_f32; 5usize],
30354 vel_yaw: [0.0_f32; 5usize],
30355 command: [0_u16; 5usize],
30356 valid_points: 0_u8,
30357 };
30358 #[cfg(feature = "arbitrary")]
30359 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30360 use arbitrary::{Arbitrary, Unstructured};
30361 let mut buf = [0u8; 1024];
30362 rng.fill_bytes(&mut buf);
30363 let mut unstructured = Unstructured::new(&buf);
30364 Self::arbitrary(&mut unstructured).unwrap_or_default()
30365 }
30366}
30367impl Default for TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
30368 fn default() -> Self {
30369 Self::DEFAULT.clone()
30370 }
30371}
30372impl MessageData for TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
30373 type Message = MavMessage;
30374 const ID: u32 = 332u32;
30375 const NAME: &'static str = "TRAJECTORY_REPRESENTATION_WAYPOINTS";
30376 const EXTRA_CRC: u8 = 236u8;
30377 const ENCODED_LEN: usize = 239usize;
30378 fn deser(
30379 _version: MavlinkVersion,
30380 __input: &[u8],
30381 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30382 let avail_len = __input.len();
30383 let mut payload_buf = [0; Self::ENCODED_LEN];
30384 let mut buf = if avail_len < Self::ENCODED_LEN {
30385 payload_buf[0..avail_len].copy_from_slice(__input);
30386 Bytes::new(&payload_buf)
30387 } else {
30388 Bytes::new(__input)
30389 };
30390 let mut __struct = Self::default();
30391 __struct.time_usec = buf.get_u64_le();
30392 for v in &mut __struct.pos_x {
30393 let val = buf.get_f32_le();
30394 *v = val;
30395 }
30396 for v in &mut __struct.pos_y {
30397 let val = buf.get_f32_le();
30398 *v = val;
30399 }
30400 for v in &mut __struct.pos_z {
30401 let val = buf.get_f32_le();
30402 *v = val;
30403 }
30404 for v in &mut __struct.vel_x {
30405 let val = buf.get_f32_le();
30406 *v = val;
30407 }
30408 for v in &mut __struct.vel_y {
30409 let val = buf.get_f32_le();
30410 *v = val;
30411 }
30412 for v in &mut __struct.vel_z {
30413 let val = buf.get_f32_le();
30414 *v = val;
30415 }
30416 for v in &mut __struct.acc_x {
30417 let val = buf.get_f32_le();
30418 *v = val;
30419 }
30420 for v in &mut __struct.acc_y {
30421 let val = buf.get_f32_le();
30422 *v = val;
30423 }
30424 for v in &mut __struct.acc_z {
30425 let val = buf.get_f32_le();
30426 *v = val;
30427 }
30428 for v in &mut __struct.pos_yaw {
30429 let val = buf.get_f32_le();
30430 *v = val;
30431 }
30432 for v in &mut __struct.vel_yaw {
30433 let val = buf.get_f32_le();
30434 *v = val;
30435 }
30436 for v in &mut __struct.command {
30437 let val = buf.get_u16_le();
30438 *v = val;
30439 }
30440 __struct.valid_points = buf.get_u8();
30441 Ok(__struct)
30442 }
30443 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30444 let mut __tmp = BytesMut::new(bytes);
30445 #[allow(clippy::absurd_extreme_comparisons)]
30446 #[allow(unused_comparisons)]
30447 if __tmp.remaining() < Self::ENCODED_LEN {
30448 panic!(
30449 "buffer is too small (need {} bytes, but got {})",
30450 Self::ENCODED_LEN,
30451 __tmp.remaining(),
30452 )
30453 }
30454 __tmp.put_u64_le(self.time_usec);
30455 for val in &self.pos_x {
30456 __tmp.put_f32_le(*val);
30457 }
30458 for val in &self.pos_y {
30459 __tmp.put_f32_le(*val);
30460 }
30461 for val in &self.pos_z {
30462 __tmp.put_f32_le(*val);
30463 }
30464 for val in &self.vel_x {
30465 __tmp.put_f32_le(*val);
30466 }
30467 for val in &self.vel_y {
30468 __tmp.put_f32_le(*val);
30469 }
30470 for val in &self.vel_z {
30471 __tmp.put_f32_le(*val);
30472 }
30473 for val in &self.acc_x {
30474 __tmp.put_f32_le(*val);
30475 }
30476 for val in &self.acc_y {
30477 __tmp.put_f32_le(*val);
30478 }
30479 for val in &self.acc_z {
30480 __tmp.put_f32_le(*val);
30481 }
30482 for val in &self.pos_yaw {
30483 __tmp.put_f32_le(*val);
30484 }
30485 for val in &self.vel_yaw {
30486 __tmp.put_f32_le(*val);
30487 }
30488 for val in &self.command {
30489 __tmp.put_u16_le(*val);
30490 }
30491 __tmp.put_u8(self.valid_points);
30492 if matches!(version, MavlinkVersion::V2) {
30493 let len = __tmp.len();
30494 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30495 } else {
30496 __tmp.len()
30497 }
30498 }
30499}
30500#[doc = "Message for transporting \"arbitrary\" variable-length data from one component to another (broadcast is not forbidden, but discouraged). The encoding of the data is usually extension specific, i.e. determined by the source, and is usually not documented as part of the MAVLink specification."]
30501#[doc = ""]
30502#[doc = "ID: 385"]
30503#[derive(Debug, Clone, PartialEq)]
30504#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30505#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30506#[cfg_attr(feature = "ts", derive(TS))]
30507#[cfg_attr(feature = "ts", ts(export))]
30508pub struct TUNNEL_DATA {
30509 #[doc = "A code that identifies the content of the payload (0 for unknown, which is the default). If this code is less than 32768, it is a 'registered' payload type and the corresponding code should be added to the MAV_TUNNEL_PAYLOAD_TYPE enum. Software creators can register blocks of types as needed. Codes greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase."]
30510 pub payload_type: MavTunnelPayloadType,
30511 #[doc = "System ID (can be 0 for broadcast, but this is discouraged)"]
30512 pub target_system: u8,
30513 #[doc = "Component ID (can be 0 for broadcast, but this is discouraged)"]
30514 pub target_component: u8,
30515 #[doc = "Length of the data transported in payload"]
30516 pub payload_length: u8,
30517 #[doc = "Variable length payload. The payload length is defined by payload_length. The entire content of this block is opaque unless you understand the encoding specified by payload_type."]
30518 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30519 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30520 pub payload: [u8; 128],
30521}
30522impl TUNNEL_DATA {
30523 pub const ENCODED_LEN: usize = 133usize;
30524 pub const DEFAULT: Self = Self {
30525 payload_type: MavTunnelPayloadType::DEFAULT,
30526 target_system: 0_u8,
30527 target_component: 0_u8,
30528 payload_length: 0_u8,
30529 payload: [0_u8; 128usize],
30530 };
30531 #[cfg(feature = "arbitrary")]
30532 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30533 use arbitrary::{Arbitrary, Unstructured};
30534 let mut buf = [0u8; 1024];
30535 rng.fill_bytes(&mut buf);
30536 let mut unstructured = Unstructured::new(&buf);
30537 Self::arbitrary(&mut unstructured).unwrap_or_default()
30538 }
30539}
30540impl Default for TUNNEL_DATA {
30541 fn default() -> Self {
30542 Self::DEFAULT.clone()
30543 }
30544}
30545impl MessageData for TUNNEL_DATA {
30546 type Message = MavMessage;
30547 const ID: u32 = 385u32;
30548 const NAME: &'static str = "TUNNEL";
30549 const EXTRA_CRC: u8 = 147u8;
30550 const ENCODED_LEN: usize = 133usize;
30551 fn deser(
30552 _version: MavlinkVersion,
30553 __input: &[u8],
30554 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30555 let avail_len = __input.len();
30556 let mut payload_buf = [0; Self::ENCODED_LEN];
30557 let mut buf = if avail_len < Self::ENCODED_LEN {
30558 payload_buf[0..avail_len].copy_from_slice(__input);
30559 Bytes::new(&payload_buf)
30560 } else {
30561 Bytes::new(__input)
30562 };
30563 let mut __struct = Self::default();
30564 let tmp = buf.get_u16_le();
30565 __struct.payload_type = FromPrimitive::from_u16(tmp).ok_or(
30566 ::mavlink_core::error::ParserError::InvalidEnum {
30567 enum_type: "MavTunnelPayloadType",
30568 value: tmp as u64,
30569 },
30570 )?;
30571 __struct.target_system = buf.get_u8();
30572 __struct.target_component = buf.get_u8();
30573 __struct.payload_length = buf.get_u8();
30574 for v in &mut __struct.payload {
30575 let val = buf.get_u8();
30576 *v = val;
30577 }
30578 Ok(__struct)
30579 }
30580 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30581 let mut __tmp = BytesMut::new(bytes);
30582 #[allow(clippy::absurd_extreme_comparisons)]
30583 #[allow(unused_comparisons)]
30584 if __tmp.remaining() < Self::ENCODED_LEN {
30585 panic!(
30586 "buffer is too small (need {} bytes, but got {})",
30587 Self::ENCODED_LEN,
30588 __tmp.remaining(),
30589 )
30590 }
30591 __tmp.put_u16_le(self.payload_type as u16);
30592 __tmp.put_u8(self.target_system);
30593 __tmp.put_u8(self.target_component);
30594 __tmp.put_u8(self.payload_length);
30595 for val in &self.payload {
30596 __tmp.put_u8(*val);
30597 }
30598 if matches!(version, MavlinkVersion::V2) {
30599 let len = __tmp.len();
30600 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30601 } else {
30602 __tmp.len()
30603 }
30604 }
30605}
30606#[doc = "System status specific to ualberta uav."]
30607#[doc = ""]
30608#[doc = "ID: 222"]
30609#[derive(Debug, Clone, PartialEq)]
30610#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30611#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30612#[cfg_attr(feature = "ts", derive(TS))]
30613#[cfg_attr(feature = "ts", ts(export))]
30614pub struct UALBERTA_SYS_STATUS_DATA {
30615 #[doc = "System mode, see UALBERTA_AUTOPILOT_MODE ENUM"]
30616 pub mode: u8,
30617 #[doc = "Navigation mode, see UALBERTA_NAV_MODE ENUM"]
30618 pub nav_mode: u8,
30619 #[doc = "Pilot mode, see UALBERTA_PILOT_MODE"]
30620 pub pilot: u8,
30621}
30622impl UALBERTA_SYS_STATUS_DATA {
30623 pub const ENCODED_LEN: usize = 3usize;
30624 pub const DEFAULT: Self = Self {
30625 mode: 0_u8,
30626 nav_mode: 0_u8,
30627 pilot: 0_u8,
30628 };
30629 #[cfg(feature = "arbitrary")]
30630 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30631 use arbitrary::{Arbitrary, Unstructured};
30632 let mut buf = [0u8; 1024];
30633 rng.fill_bytes(&mut buf);
30634 let mut unstructured = Unstructured::new(&buf);
30635 Self::arbitrary(&mut unstructured).unwrap_or_default()
30636 }
30637}
30638impl Default for UALBERTA_SYS_STATUS_DATA {
30639 fn default() -> Self {
30640 Self::DEFAULT.clone()
30641 }
30642}
30643impl MessageData for UALBERTA_SYS_STATUS_DATA {
30644 type Message = MavMessage;
30645 const ID: u32 = 222u32;
30646 const NAME: &'static str = "UALBERTA_SYS_STATUS";
30647 const EXTRA_CRC: u8 = 15u8;
30648 const ENCODED_LEN: usize = 3usize;
30649 fn deser(
30650 _version: MavlinkVersion,
30651 __input: &[u8],
30652 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30653 let avail_len = __input.len();
30654 let mut payload_buf = [0; Self::ENCODED_LEN];
30655 let mut buf = if avail_len < Self::ENCODED_LEN {
30656 payload_buf[0..avail_len].copy_from_slice(__input);
30657 Bytes::new(&payload_buf)
30658 } else {
30659 Bytes::new(__input)
30660 };
30661 let mut __struct = Self::default();
30662 __struct.mode = buf.get_u8();
30663 __struct.nav_mode = buf.get_u8();
30664 __struct.pilot = buf.get_u8();
30665 Ok(__struct)
30666 }
30667 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30668 let mut __tmp = BytesMut::new(bytes);
30669 #[allow(clippy::absurd_extreme_comparisons)]
30670 #[allow(unused_comparisons)]
30671 if __tmp.remaining() < Self::ENCODED_LEN {
30672 panic!(
30673 "buffer is too small (need {} bytes, but got {})",
30674 Self::ENCODED_LEN,
30675 __tmp.remaining(),
30676 )
30677 }
30678 __tmp.put_u8(self.mode);
30679 __tmp.put_u8(self.nav_mode);
30680 __tmp.put_u8(self.pilot);
30681 if matches!(version, MavlinkVersion::V2) {
30682 let len = __tmp.len();
30683 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30684 } else {
30685 __tmp.len()
30686 }
30687 }
30688}
30689#[doc = "General information describing a particular UAVCAN node. Please refer to the definition of the UAVCAN service \"uavcan.protocol.GetNodeInfo\" for the background information. This message should be emitted by the system whenever a new node appears online, or an existing node reboots. Additionally, it can be emitted upon request from the other end of the MAVLink channel (see MAV_CMD_UAVCAN_GET_NODE_INFO). It is also not prohibited to emit this message unconditionally at a low frequency. The UAVCAN specification is available at <http://uavcan.org>."]
30690#[doc = ""]
30691#[doc = "ID: 311"]
30692#[derive(Debug, Clone, PartialEq)]
30693#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30694#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30695#[cfg_attr(feature = "ts", derive(TS))]
30696#[cfg_attr(feature = "ts", ts(export))]
30697pub struct UAVCAN_NODE_INFO_DATA {
30698 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
30699 pub time_usec: u64,
30700 #[doc = "Time since the start-up of the node."]
30701 pub uptime_sec: u32,
30702 #[doc = "Version control system (VCS) revision identifier (e.g. git short commit hash). 0 if unknown."]
30703 pub sw_vcs_commit: u32,
30704 #[doc = "Node name string. For example, \"sapog.px4.io\"."]
30705 #[cfg_attr(feature = "ts", ts(type = "string"))]
30706 pub name: CharArray<80>,
30707 #[doc = "Hardware major version number."]
30708 pub hw_version_major: u8,
30709 #[doc = "Hardware minor version number."]
30710 pub hw_version_minor: u8,
30711 #[doc = "Hardware unique 128-bit ID."]
30712 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30713 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30714 pub hw_unique_id: [u8; 16],
30715 #[doc = "Software major version number."]
30716 pub sw_version_major: u8,
30717 #[doc = "Software minor version number."]
30718 pub sw_version_minor: u8,
30719}
30720impl UAVCAN_NODE_INFO_DATA {
30721 pub const ENCODED_LEN: usize = 116usize;
30722 pub const DEFAULT: Self = Self {
30723 time_usec: 0_u64,
30724 uptime_sec: 0_u32,
30725 sw_vcs_commit: 0_u32,
30726 name: CharArray::new([0_u8; 80usize]),
30727 hw_version_major: 0_u8,
30728 hw_version_minor: 0_u8,
30729 hw_unique_id: [0_u8; 16usize],
30730 sw_version_major: 0_u8,
30731 sw_version_minor: 0_u8,
30732 };
30733 #[cfg(feature = "arbitrary")]
30734 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30735 use arbitrary::{Arbitrary, Unstructured};
30736 let mut buf = [0u8; 1024];
30737 rng.fill_bytes(&mut buf);
30738 let mut unstructured = Unstructured::new(&buf);
30739 Self::arbitrary(&mut unstructured).unwrap_or_default()
30740 }
30741}
30742impl Default for UAVCAN_NODE_INFO_DATA {
30743 fn default() -> Self {
30744 Self::DEFAULT.clone()
30745 }
30746}
30747impl MessageData for UAVCAN_NODE_INFO_DATA {
30748 type Message = MavMessage;
30749 const ID: u32 = 311u32;
30750 const NAME: &'static str = "UAVCAN_NODE_INFO";
30751 const EXTRA_CRC: u8 = 95u8;
30752 const ENCODED_LEN: usize = 116usize;
30753 fn deser(
30754 _version: MavlinkVersion,
30755 __input: &[u8],
30756 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30757 let avail_len = __input.len();
30758 let mut payload_buf = [0; Self::ENCODED_LEN];
30759 let mut buf = if avail_len < Self::ENCODED_LEN {
30760 payload_buf[0..avail_len].copy_from_slice(__input);
30761 Bytes::new(&payload_buf)
30762 } else {
30763 Bytes::new(__input)
30764 };
30765 let mut __struct = Self::default();
30766 __struct.time_usec = buf.get_u64_le();
30767 __struct.uptime_sec = buf.get_u32_le();
30768 __struct.sw_vcs_commit = buf.get_u32_le();
30769 let mut tmp = [0_u8; 80usize];
30770 for v in &mut tmp {
30771 *v = buf.get_u8();
30772 }
30773 __struct.name = CharArray::new(tmp);
30774 __struct.hw_version_major = buf.get_u8();
30775 __struct.hw_version_minor = buf.get_u8();
30776 for v in &mut __struct.hw_unique_id {
30777 let val = buf.get_u8();
30778 *v = val;
30779 }
30780 __struct.sw_version_major = buf.get_u8();
30781 __struct.sw_version_minor = buf.get_u8();
30782 Ok(__struct)
30783 }
30784 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30785 let mut __tmp = BytesMut::new(bytes);
30786 #[allow(clippy::absurd_extreme_comparisons)]
30787 #[allow(unused_comparisons)]
30788 if __tmp.remaining() < Self::ENCODED_LEN {
30789 panic!(
30790 "buffer is too small (need {} bytes, but got {})",
30791 Self::ENCODED_LEN,
30792 __tmp.remaining(),
30793 )
30794 }
30795 __tmp.put_u64_le(self.time_usec);
30796 __tmp.put_u32_le(self.uptime_sec);
30797 __tmp.put_u32_le(self.sw_vcs_commit);
30798 for val in &self.name {
30799 __tmp.put_u8(*val);
30800 }
30801 __tmp.put_u8(self.hw_version_major);
30802 __tmp.put_u8(self.hw_version_minor);
30803 for val in &self.hw_unique_id {
30804 __tmp.put_u8(*val);
30805 }
30806 __tmp.put_u8(self.sw_version_major);
30807 __tmp.put_u8(self.sw_version_minor);
30808 if matches!(version, MavlinkVersion::V2) {
30809 let len = __tmp.len();
30810 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30811 } else {
30812 __tmp.len()
30813 }
30814 }
30815}
30816#[doc = "General status information of an UAVCAN node. Please refer to the definition of the UAVCAN message \"uavcan.protocol.NodeStatus\" for the background information. The UAVCAN specification is available at <http://uavcan.org>."]
30817#[doc = ""]
30818#[doc = "ID: 310"]
30819#[derive(Debug, Clone, PartialEq)]
30820#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30821#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30822#[cfg_attr(feature = "ts", derive(TS))]
30823#[cfg_attr(feature = "ts", ts(export))]
30824pub struct UAVCAN_NODE_STATUS_DATA {
30825 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
30826 pub time_usec: u64,
30827 #[doc = "Time since the start-up of the node."]
30828 pub uptime_sec: u32,
30829 #[doc = "Vendor-specific status information."]
30830 pub vendor_specific_status_code: u16,
30831 #[doc = "Generalized node health status."]
30832 pub health: UavcanNodeHealth,
30833 #[doc = "Generalized operating mode."]
30834 pub mode: UavcanNodeMode,
30835 #[doc = "Not used currently."]
30836 pub sub_mode: u8,
30837}
30838impl UAVCAN_NODE_STATUS_DATA {
30839 pub const ENCODED_LEN: usize = 17usize;
30840 pub const DEFAULT: Self = Self {
30841 time_usec: 0_u64,
30842 uptime_sec: 0_u32,
30843 vendor_specific_status_code: 0_u16,
30844 health: UavcanNodeHealth::DEFAULT,
30845 mode: UavcanNodeMode::DEFAULT,
30846 sub_mode: 0_u8,
30847 };
30848 #[cfg(feature = "arbitrary")]
30849 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30850 use arbitrary::{Arbitrary, Unstructured};
30851 let mut buf = [0u8; 1024];
30852 rng.fill_bytes(&mut buf);
30853 let mut unstructured = Unstructured::new(&buf);
30854 Self::arbitrary(&mut unstructured).unwrap_or_default()
30855 }
30856}
30857impl Default for UAVCAN_NODE_STATUS_DATA {
30858 fn default() -> Self {
30859 Self::DEFAULT.clone()
30860 }
30861}
30862impl MessageData for UAVCAN_NODE_STATUS_DATA {
30863 type Message = MavMessage;
30864 const ID: u32 = 310u32;
30865 const NAME: &'static str = "UAVCAN_NODE_STATUS";
30866 const EXTRA_CRC: u8 = 28u8;
30867 const ENCODED_LEN: usize = 17usize;
30868 fn deser(
30869 _version: MavlinkVersion,
30870 __input: &[u8],
30871 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30872 let avail_len = __input.len();
30873 let mut payload_buf = [0; Self::ENCODED_LEN];
30874 let mut buf = if avail_len < Self::ENCODED_LEN {
30875 payload_buf[0..avail_len].copy_from_slice(__input);
30876 Bytes::new(&payload_buf)
30877 } else {
30878 Bytes::new(__input)
30879 };
30880 let mut __struct = Self::default();
30881 __struct.time_usec = buf.get_u64_le();
30882 __struct.uptime_sec = buf.get_u32_le();
30883 __struct.vendor_specific_status_code = buf.get_u16_le();
30884 let tmp = buf.get_u8();
30885 __struct.health =
30886 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30887 enum_type: "UavcanNodeHealth",
30888 value: tmp as u64,
30889 })?;
30890 let tmp = buf.get_u8();
30891 __struct.mode =
30892 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30893 enum_type: "UavcanNodeMode",
30894 value: tmp as u64,
30895 })?;
30896 __struct.sub_mode = buf.get_u8();
30897 Ok(__struct)
30898 }
30899 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30900 let mut __tmp = BytesMut::new(bytes);
30901 #[allow(clippy::absurd_extreme_comparisons)]
30902 #[allow(unused_comparisons)]
30903 if __tmp.remaining() < Self::ENCODED_LEN {
30904 panic!(
30905 "buffer is too small (need {} bytes, but got {})",
30906 Self::ENCODED_LEN,
30907 __tmp.remaining(),
30908 )
30909 }
30910 __tmp.put_u64_le(self.time_usec);
30911 __tmp.put_u32_le(self.uptime_sec);
30912 __tmp.put_u16_le(self.vendor_specific_status_code);
30913 __tmp.put_u8(self.health as u8);
30914 __tmp.put_u8(self.mode as u8);
30915 __tmp.put_u8(self.sub_mode);
30916 if matches!(version, MavlinkVersion::V2) {
30917 let len = __tmp.len();
30918 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30919 } else {
30920 __tmp.len()
30921 }
30922 }
30923}
30924#[doc = "The global position resulting from GPS and sensor fusion."]
30925#[doc = ""]
30926#[doc = "ID: 340"]
30927#[derive(Debug, Clone, PartialEq)]
30928#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30929#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30930#[cfg_attr(feature = "ts", derive(TS))]
30931#[cfg_attr(feature = "ts", ts(export))]
30932pub struct UTM_GLOBAL_POSITION_DATA {
30933 #[doc = "Time of applicability of position (microseconds since UNIX epoch)."]
30934 pub time: u64,
30935 #[doc = "Latitude (WGS84)"]
30936 pub lat: i32,
30937 #[doc = "Longitude (WGS84)"]
30938 pub lon: i32,
30939 #[doc = "Altitude (WGS84)"]
30940 pub alt: i32,
30941 #[doc = "Altitude above ground"]
30942 pub relative_alt: i32,
30943 #[doc = "Next waypoint, latitude (WGS84)"]
30944 pub next_lat: i32,
30945 #[doc = "Next waypoint, longitude (WGS84)"]
30946 pub next_lon: i32,
30947 #[doc = "Next waypoint, altitude (WGS84)"]
30948 pub next_alt: i32,
30949 #[doc = "Ground X speed (latitude, positive north)"]
30950 pub vx: i16,
30951 #[doc = "Ground Y speed (longitude, positive east)"]
30952 pub vy: i16,
30953 #[doc = "Ground Z speed (altitude, positive down)"]
30954 pub vz: i16,
30955 #[doc = "Horizontal position uncertainty (standard deviation)"]
30956 pub h_acc: u16,
30957 #[doc = "Altitude uncertainty (standard deviation)"]
30958 pub v_acc: u16,
30959 #[doc = "Speed uncertainty (standard deviation)"]
30960 pub vel_acc: u16,
30961 #[doc = "Time until next update. Set to 0 if unknown or in data driven mode."]
30962 pub update_rate: u16,
30963 #[doc = "Unique UAS ID."]
30964 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30965 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30966 pub uas_id: [u8; 18],
30967 #[doc = "Flight state"]
30968 pub flight_state: UtmFlightState,
30969 #[doc = "Bitwise OR combination of the data available flags."]
30970 pub flags: UtmDataAvailFlags,
30971}
30972impl UTM_GLOBAL_POSITION_DATA {
30973 pub const ENCODED_LEN: usize = 70usize;
30974 pub const DEFAULT: Self = Self {
30975 time: 0_u64,
30976 lat: 0_i32,
30977 lon: 0_i32,
30978 alt: 0_i32,
30979 relative_alt: 0_i32,
30980 next_lat: 0_i32,
30981 next_lon: 0_i32,
30982 next_alt: 0_i32,
30983 vx: 0_i16,
30984 vy: 0_i16,
30985 vz: 0_i16,
30986 h_acc: 0_u16,
30987 v_acc: 0_u16,
30988 vel_acc: 0_u16,
30989 update_rate: 0_u16,
30990 uas_id: [0_u8; 18usize],
30991 flight_state: UtmFlightState::DEFAULT,
30992 flags: UtmDataAvailFlags::DEFAULT,
30993 };
30994 #[cfg(feature = "arbitrary")]
30995 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30996 use arbitrary::{Arbitrary, Unstructured};
30997 let mut buf = [0u8; 1024];
30998 rng.fill_bytes(&mut buf);
30999 let mut unstructured = Unstructured::new(&buf);
31000 Self::arbitrary(&mut unstructured).unwrap_or_default()
31001 }
31002}
31003impl Default for UTM_GLOBAL_POSITION_DATA {
31004 fn default() -> Self {
31005 Self::DEFAULT.clone()
31006 }
31007}
31008impl MessageData for UTM_GLOBAL_POSITION_DATA {
31009 type Message = MavMessage;
31010 const ID: u32 = 340u32;
31011 const NAME: &'static str = "UTM_GLOBAL_POSITION";
31012 const EXTRA_CRC: u8 = 99u8;
31013 const ENCODED_LEN: usize = 70usize;
31014 fn deser(
31015 _version: MavlinkVersion,
31016 __input: &[u8],
31017 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31018 let avail_len = __input.len();
31019 let mut payload_buf = [0; Self::ENCODED_LEN];
31020 let mut buf = if avail_len < Self::ENCODED_LEN {
31021 payload_buf[0..avail_len].copy_from_slice(__input);
31022 Bytes::new(&payload_buf)
31023 } else {
31024 Bytes::new(__input)
31025 };
31026 let mut __struct = Self::default();
31027 __struct.time = buf.get_u64_le();
31028 __struct.lat = buf.get_i32_le();
31029 __struct.lon = buf.get_i32_le();
31030 __struct.alt = buf.get_i32_le();
31031 __struct.relative_alt = buf.get_i32_le();
31032 __struct.next_lat = buf.get_i32_le();
31033 __struct.next_lon = buf.get_i32_le();
31034 __struct.next_alt = buf.get_i32_le();
31035 __struct.vx = buf.get_i16_le();
31036 __struct.vy = buf.get_i16_le();
31037 __struct.vz = buf.get_i16_le();
31038 __struct.h_acc = buf.get_u16_le();
31039 __struct.v_acc = buf.get_u16_le();
31040 __struct.vel_acc = buf.get_u16_le();
31041 __struct.update_rate = buf.get_u16_le();
31042 for v in &mut __struct.uas_id {
31043 let val = buf.get_u8();
31044 *v = val;
31045 }
31046 let tmp = buf.get_u8();
31047 __struct.flight_state =
31048 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31049 enum_type: "UtmFlightState",
31050 value: tmp as u64,
31051 })?;
31052 let tmp = buf.get_u8();
31053 __struct.flags = UtmDataAvailFlags::from_bits(tmp).ok_or(
31054 ::mavlink_core::error::ParserError::InvalidFlag {
31055 flag_type: "UtmDataAvailFlags",
31056 value: tmp as u64,
31057 },
31058 )?;
31059 Ok(__struct)
31060 }
31061 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31062 let mut __tmp = BytesMut::new(bytes);
31063 #[allow(clippy::absurd_extreme_comparisons)]
31064 #[allow(unused_comparisons)]
31065 if __tmp.remaining() < Self::ENCODED_LEN {
31066 panic!(
31067 "buffer is too small (need {} bytes, but got {})",
31068 Self::ENCODED_LEN,
31069 __tmp.remaining(),
31070 )
31071 }
31072 __tmp.put_u64_le(self.time);
31073 __tmp.put_i32_le(self.lat);
31074 __tmp.put_i32_le(self.lon);
31075 __tmp.put_i32_le(self.alt);
31076 __tmp.put_i32_le(self.relative_alt);
31077 __tmp.put_i32_le(self.next_lat);
31078 __tmp.put_i32_le(self.next_lon);
31079 __tmp.put_i32_le(self.next_alt);
31080 __tmp.put_i16_le(self.vx);
31081 __tmp.put_i16_le(self.vy);
31082 __tmp.put_i16_le(self.vz);
31083 __tmp.put_u16_le(self.h_acc);
31084 __tmp.put_u16_le(self.v_acc);
31085 __tmp.put_u16_le(self.vel_acc);
31086 __tmp.put_u16_le(self.update_rate);
31087 for val in &self.uas_id {
31088 __tmp.put_u8(*val);
31089 }
31090 __tmp.put_u8(self.flight_state as u8);
31091 __tmp.put_u8(self.flags.bits());
31092 if matches!(version, MavlinkVersion::V2) {
31093 let len = __tmp.len();
31094 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31095 } else {
31096 __tmp.len()
31097 }
31098 }
31099}
31100#[doc = "Message implementing parts of the V2 payload specs in V1 frames for transitional support."]
31101#[doc = ""]
31102#[doc = "ID: 248"]
31103#[derive(Debug, Clone, PartialEq)]
31104#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31105#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31106#[cfg_attr(feature = "ts", derive(TS))]
31107#[cfg_attr(feature = "ts", ts(export))]
31108pub struct V2_EXTENSION_DATA {
31109 #[doc = "A code that identifies the software component that understands this message (analogous to USB device classes or mime type strings). If this code is less than 32768, it is considered a 'registered' protocol extension and the corresponding entry should be added to <https://github.com/mavlink/mavlink/definition_files/extension_message_ids.xml>. Software creators can register blocks of message IDs as needed (useful for GCS specific metadata, etc...). Message_types greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase."]
31110 pub message_type: u16,
31111 #[doc = "Network ID (0 for broadcast)"]
31112 pub target_network: u8,
31113 #[doc = "System ID (0 for broadcast)"]
31114 pub target_system: u8,
31115 #[doc = "Component ID (0 for broadcast)"]
31116 pub target_component: u8,
31117 #[doc = "Variable length payload. The length must be encoded in the payload as part of the message_type protocol, e.g. by including the length as payload data, or by terminating the payload data with a non-zero marker. This is required in order to reconstruct zero-terminated payloads that are (or otherwise would be) trimmed by MAVLink 2 empty-byte truncation. The entire content of the payload block is opaque unless you understand the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the MAVLink specification."]
31118 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31119 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
31120 pub payload: [u8; 249],
31121}
31122impl V2_EXTENSION_DATA {
31123 pub const ENCODED_LEN: usize = 254usize;
31124 pub const DEFAULT: Self = Self {
31125 message_type: 0_u16,
31126 target_network: 0_u8,
31127 target_system: 0_u8,
31128 target_component: 0_u8,
31129 payload: [0_u8; 249usize],
31130 };
31131 #[cfg(feature = "arbitrary")]
31132 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31133 use arbitrary::{Arbitrary, Unstructured};
31134 let mut buf = [0u8; 1024];
31135 rng.fill_bytes(&mut buf);
31136 let mut unstructured = Unstructured::new(&buf);
31137 Self::arbitrary(&mut unstructured).unwrap_or_default()
31138 }
31139}
31140impl Default for V2_EXTENSION_DATA {
31141 fn default() -> Self {
31142 Self::DEFAULT.clone()
31143 }
31144}
31145impl MessageData for V2_EXTENSION_DATA {
31146 type Message = MavMessage;
31147 const ID: u32 = 248u32;
31148 const NAME: &'static str = "V2_EXTENSION";
31149 const EXTRA_CRC: u8 = 8u8;
31150 const ENCODED_LEN: usize = 254usize;
31151 fn deser(
31152 _version: MavlinkVersion,
31153 __input: &[u8],
31154 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31155 let avail_len = __input.len();
31156 let mut payload_buf = [0; Self::ENCODED_LEN];
31157 let mut buf = if avail_len < Self::ENCODED_LEN {
31158 payload_buf[0..avail_len].copy_from_slice(__input);
31159 Bytes::new(&payload_buf)
31160 } else {
31161 Bytes::new(__input)
31162 };
31163 let mut __struct = Self::default();
31164 __struct.message_type = buf.get_u16_le();
31165 __struct.target_network = buf.get_u8();
31166 __struct.target_system = buf.get_u8();
31167 __struct.target_component = buf.get_u8();
31168 for v in &mut __struct.payload {
31169 let val = buf.get_u8();
31170 *v = val;
31171 }
31172 Ok(__struct)
31173 }
31174 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31175 let mut __tmp = BytesMut::new(bytes);
31176 #[allow(clippy::absurd_extreme_comparisons)]
31177 #[allow(unused_comparisons)]
31178 if __tmp.remaining() < Self::ENCODED_LEN {
31179 panic!(
31180 "buffer is too small (need {} bytes, but got {})",
31181 Self::ENCODED_LEN,
31182 __tmp.remaining(),
31183 )
31184 }
31185 __tmp.put_u16_le(self.message_type);
31186 __tmp.put_u8(self.target_network);
31187 __tmp.put_u8(self.target_system);
31188 __tmp.put_u8(self.target_component);
31189 for val in &self.payload {
31190 __tmp.put_u8(*val);
31191 }
31192 if matches!(version, MavlinkVersion::V2) {
31193 let len = __tmp.len();
31194 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31195 } else {
31196 __tmp.len()
31197 }
31198 }
31199}
31200#[doc = "Metrics typically displayed on a HUD for fixed wing aircraft."]
31201#[doc = ""]
31202#[doc = "ID: 74"]
31203#[derive(Debug, Clone, PartialEq)]
31204#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31205#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31206#[cfg_attr(feature = "ts", derive(TS))]
31207#[cfg_attr(feature = "ts", ts(export))]
31208pub struct VFR_HUD_DATA {
31209 #[doc = "Vehicle speed in form appropriate for vehicle type. For standard aircraft this is typically calibrated airspeed (CAS) or indicated airspeed (IAS) - either of which can be used by a pilot to estimate stall speed."]
31210 pub airspeed: f32,
31211 #[doc = "Current ground speed."]
31212 pub groundspeed: f32,
31213 #[doc = "Current altitude (MSL)."]
31214 pub alt: f32,
31215 #[doc = "Current climb rate."]
31216 pub climb: f32,
31217 #[doc = "Current heading in compass units (0-360, 0=north)."]
31218 pub heading: i16,
31219 #[doc = "Current throttle setting (0 to 100)."]
31220 pub throttle: u16,
31221}
31222impl VFR_HUD_DATA {
31223 pub const ENCODED_LEN: usize = 20usize;
31224 pub const DEFAULT: Self = Self {
31225 airspeed: 0.0_f32,
31226 groundspeed: 0.0_f32,
31227 alt: 0.0_f32,
31228 climb: 0.0_f32,
31229 heading: 0_i16,
31230 throttle: 0_u16,
31231 };
31232 #[cfg(feature = "arbitrary")]
31233 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31234 use arbitrary::{Arbitrary, Unstructured};
31235 let mut buf = [0u8; 1024];
31236 rng.fill_bytes(&mut buf);
31237 let mut unstructured = Unstructured::new(&buf);
31238 Self::arbitrary(&mut unstructured).unwrap_or_default()
31239 }
31240}
31241impl Default for VFR_HUD_DATA {
31242 fn default() -> Self {
31243 Self::DEFAULT.clone()
31244 }
31245}
31246impl MessageData for VFR_HUD_DATA {
31247 type Message = MavMessage;
31248 const ID: u32 = 74u32;
31249 const NAME: &'static str = "VFR_HUD";
31250 const EXTRA_CRC: u8 = 20u8;
31251 const ENCODED_LEN: usize = 20usize;
31252 fn deser(
31253 _version: MavlinkVersion,
31254 __input: &[u8],
31255 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31256 let avail_len = __input.len();
31257 let mut payload_buf = [0; Self::ENCODED_LEN];
31258 let mut buf = if avail_len < Self::ENCODED_LEN {
31259 payload_buf[0..avail_len].copy_from_slice(__input);
31260 Bytes::new(&payload_buf)
31261 } else {
31262 Bytes::new(__input)
31263 };
31264 let mut __struct = Self::default();
31265 __struct.airspeed = buf.get_f32_le();
31266 __struct.groundspeed = buf.get_f32_le();
31267 __struct.alt = buf.get_f32_le();
31268 __struct.climb = buf.get_f32_le();
31269 __struct.heading = buf.get_i16_le();
31270 __struct.throttle = buf.get_u16_le();
31271 Ok(__struct)
31272 }
31273 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31274 let mut __tmp = BytesMut::new(bytes);
31275 #[allow(clippy::absurd_extreme_comparisons)]
31276 #[allow(unused_comparisons)]
31277 if __tmp.remaining() < Self::ENCODED_LEN {
31278 panic!(
31279 "buffer is too small (need {} bytes, but got {})",
31280 Self::ENCODED_LEN,
31281 __tmp.remaining(),
31282 )
31283 }
31284 __tmp.put_f32_le(self.airspeed);
31285 __tmp.put_f32_le(self.groundspeed);
31286 __tmp.put_f32_le(self.alt);
31287 __tmp.put_f32_le(self.climb);
31288 __tmp.put_i16_le(self.heading);
31289 __tmp.put_u16_le(self.throttle);
31290 if matches!(version, MavlinkVersion::V2) {
31291 let len = __tmp.len();
31292 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31293 } else {
31294 __tmp.len()
31295 }
31296 }
31297}
31298#[doc = "Vibration levels and accelerometer clipping."]
31299#[doc = ""]
31300#[doc = "ID: 241"]
31301#[derive(Debug, Clone, PartialEq)]
31302#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31303#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31304#[cfg_attr(feature = "ts", derive(TS))]
31305#[cfg_attr(feature = "ts", ts(export))]
31306pub struct VIBRATION_DATA {
31307 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
31308 pub time_usec: u64,
31309 #[doc = "Vibration levels on X-axis"]
31310 pub vibration_x: f32,
31311 #[doc = "Vibration levels on Y-axis"]
31312 pub vibration_y: f32,
31313 #[doc = "Vibration levels on Z-axis"]
31314 pub vibration_z: f32,
31315 #[doc = "first accelerometer clipping count"]
31316 pub clipping_0: u32,
31317 #[doc = "second accelerometer clipping count"]
31318 pub clipping_1: u32,
31319 #[doc = "third accelerometer clipping count"]
31320 pub clipping_2: u32,
31321}
31322impl VIBRATION_DATA {
31323 pub const ENCODED_LEN: usize = 32usize;
31324 pub const DEFAULT: Self = Self {
31325 time_usec: 0_u64,
31326 vibration_x: 0.0_f32,
31327 vibration_y: 0.0_f32,
31328 vibration_z: 0.0_f32,
31329 clipping_0: 0_u32,
31330 clipping_1: 0_u32,
31331 clipping_2: 0_u32,
31332 };
31333 #[cfg(feature = "arbitrary")]
31334 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31335 use arbitrary::{Arbitrary, Unstructured};
31336 let mut buf = [0u8; 1024];
31337 rng.fill_bytes(&mut buf);
31338 let mut unstructured = Unstructured::new(&buf);
31339 Self::arbitrary(&mut unstructured).unwrap_or_default()
31340 }
31341}
31342impl Default for VIBRATION_DATA {
31343 fn default() -> Self {
31344 Self::DEFAULT.clone()
31345 }
31346}
31347impl MessageData for VIBRATION_DATA {
31348 type Message = MavMessage;
31349 const ID: u32 = 241u32;
31350 const NAME: &'static str = "VIBRATION";
31351 const EXTRA_CRC: u8 = 90u8;
31352 const ENCODED_LEN: usize = 32usize;
31353 fn deser(
31354 _version: MavlinkVersion,
31355 __input: &[u8],
31356 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31357 let avail_len = __input.len();
31358 let mut payload_buf = [0; Self::ENCODED_LEN];
31359 let mut buf = if avail_len < Self::ENCODED_LEN {
31360 payload_buf[0..avail_len].copy_from_slice(__input);
31361 Bytes::new(&payload_buf)
31362 } else {
31363 Bytes::new(__input)
31364 };
31365 let mut __struct = Self::default();
31366 __struct.time_usec = buf.get_u64_le();
31367 __struct.vibration_x = buf.get_f32_le();
31368 __struct.vibration_y = buf.get_f32_le();
31369 __struct.vibration_z = buf.get_f32_le();
31370 __struct.clipping_0 = buf.get_u32_le();
31371 __struct.clipping_1 = buf.get_u32_le();
31372 __struct.clipping_2 = buf.get_u32_le();
31373 Ok(__struct)
31374 }
31375 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31376 let mut __tmp = BytesMut::new(bytes);
31377 #[allow(clippy::absurd_extreme_comparisons)]
31378 #[allow(unused_comparisons)]
31379 if __tmp.remaining() < Self::ENCODED_LEN {
31380 panic!(
31381 "buffer is too small (need {} bytes, but got {})",
31382 Self::ENCODED_LEN,
31383 __tmp.remaining(),
31384 )
31385 }
31386 __tmp.put_u64_le(self.time_usec);
31387 __tmp.put_f32_le(self.vibration_x);
31388 __tmp.put_f32_le(self.vibration_y);
31389 __tmp.put_f32_le(self.vibration_z);
31390 __tmp.put_u32_le(self.clipping_0);
31391 __tmp.put_u32_le(self.clipping_1);
31392 __tmp.put_u32_le(self.clipping_2);
31393 if matches!(version, MavlinkVersion::V2) {
31394 let len = __tmp.len();
31395 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31396 } else {
31397 __tmp.len()
31398 }
31399 }
31400}
31401#[doc = "Global position estimate from a Vicon motion system source."]
31402#[doc = ""]
31403#[doc = "ID: 104"]
31404#[derive(Debug, Clone, PartialEq)]
31405#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31406#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31407#[cfg_attr(feature = "ts", derive(TS))]
31408#[cfg_attr(feature = "ts", ts(export))]
31409pub struct VICON_POSITION_ESTIMATE_DATA {
31410 #[doc = "Timestamp (UNIX time or time since system boot)"]
31411 pub usec: u64,
31412 #[doc = "Global X position"]
31413 pub x: f32,
31414 #[doc = "Global Y position"]
31415 pub y: f32,
31416 #[doc = "Global Z position"]
31417 pub z: f32,
31418 #[doc = "Roll angle"]
31419 pub roll: f32,
31420 #[doc = "Pitch angle"]
31421 pub pitch: f32,
31422 #[doc = "Yaw angle"]
31423 pub yaw: f32,
31424 #[doc = "Row-major representation of 6x6 pose cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
31425 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31426 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31427 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
31428 pub covariance: [f32; 21],
31429}
31430impl VICON_POSITION_ESTIMATE_DATA {
31431 pub const ENCODED_LEN: usize = 116usize;
31432 pub const DEFAULT: Self = Self {
31433 usec: 0_u64,
31434 x: 0.0_f32,
31435 y: 0.0_f32,
31436 z: 0.0_f32,
31437 roll: 0.0_f32,
31438 pitch: 0.0_f32,
31439 yaw: 0.0_f32,
31440 covariance: [0.0_f32; 21usize],
31441 };
31442 #[cfg(feature = "arbitrary")]
31443 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31444 use arbitrary::{Arbitrary, Unstructured};
31445 let mut buf = [0u8; 1024];
31446 rng.fill_bytes(&mut buf);
31447 let mut unstructured = Unstructured::new(&buf);
31448 Self::arbitrary(&mut unstructured).unwrap_or_default()
31449 }
31450}
31451impl Default for VICON_POSITION_ESTIMATE_DATA {
31452 fn default() -> Self {
31453 Self::DEFAULT.clone()
31454 }
31455}
31456impl MessageData for VICON_POSITION_ESTIMATE_DATA {
31457 type Message = MavMessage;
31458 const ID: u32 = 104u32;
31459 const NAME: &'static str = "VICON_POSITION_ESTIMATE";
31460 const EXTRA_CRC: u8 = 56u8;
31461 const ENCODED_LEN: usize = 116usize;
31462 fn deser(
31463 _version: MavlinkVersion,
31464 __input: &[u8],
31465 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31466 let avail_len = __input.len();
31467 let mut payload_buf = [0; Self::ENCODED_LEN];
31468 let mut buf = if avail_len < Self::ENCODED_LEN {
31469 payload_buf[0..avail_len].copy_from_slice(__input);
31470 Bytes::new(&payload_buf)
31471 } else {
31472 Bytes::new(__input)
31473 };
31474 let mut __struct = Self::default();
31475 __struct.usec = buf.get_u64_le();
31476 __struct.x = buf.get_f32_le();
31477 __struct.y = buf.get_f32_le();
31478 __struct.z = buf.get_f32_le();
31479 __struct.roll = buf.get_f32_le();
31480 __struct.pitch = buf.get_f32_le();
31481 __struct.yaw = buf.get_f32_le();
31482 for v in &mut __struct.covariance {
31483 let val = buf.get_f32_le();
31484 *v = val;
31485 }
31486 Ok(__struct)
31487 }
31488 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31489 let mut __tmp = BytesMut::new(bytes);
31490 #[allow(clippy::absurd_extreme_comparisons)]
31491 #[allow(unused_comparisons)]
31492 if __tmp.remaining() < Self::ENCODED_LEN {
31493 panic!(
31494 "buffer is too small (need {} bytes, but got {})",
31495 Self::ENCODED_LEN,
31496 __tmp.remaining(),
31497 )
31498 }
31499 __tmp.put_u64_le(self.usec);
31500 __tmp.put_f32_le(self.x);
31501 __tmp.put_f32_le(self.y);
31502 __tmp.put_f32_le(self.z);
31503 __tmp.put_f32_le(self.roll);
31504 __tmp.put_f32_le(self.pitch);
31505 __tmp.put_f32_le(self.yaw);
31506 if matches!(version, MavlinkVersion::V2) {
31507 for val in &self.covariance {
31508 __tmp.put_f32_le(*val);
31509 }
31510 let len = __tmp.len();
31511 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31512 } else {
31513 __tmp.len()
31514 }
31515 }
31516}
31517#[doc = "Information about video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE, where param2 indicates the video stream id: 0 for all streams, 1 for first, 2 for second, etc."]
31518#[doc = ""]
31519#[doc = "ID: 269"]
31520#[derive(Debug, Clone, PartialEq)]
31521#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31522#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31523#[cfg_attr(feature = "ts", derive(TS))]
31524#[cfg_attr(feature = "ts", ts(export))]
31525pub struct VIDEO_STREAM_INFORMATION_DATA {
31526 #[doc = "Frame rate."]
31527 pub framerate: f32,
31528 #[doc = "Bit rate."]
31529 pub bitrate: u32,
31530 #[doc = "Bitmap of stream status flags."]
31531 pub flags: VideoStreamStatusFlags,
31532 #[doc = "Horizontal resolution."]
31533 pub resolution_h: u16,
31534 #[doc = "Vertical resolution."]
31535 pub resolution_v: u16,
31536 #[doc = "Video image rotation clockwise."]
31537 pub rotation: u16,
31538 #[doc = "Horizontal Field of view."]
31539 pub hfov: u16,
31540 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
31541 pub stream_id: u8,
31542 #[doc = "Number of streams available."]
31543 pub count: u8,
31544 #[doc = "Type of stream."]
31545 pub mavtype: VideoStreamType,
31546 #[doc = "Stream name."]
31547 #[cfg_attr(feature = "ts", ts(type = "string"))]
31548 pub name: CharArray<32>,
31549 #[doc = "Video stream URI (TCP or RTSP URI ground station should connect to) or port number (UDP port ground station should listen to)."]
31550 #[cfg_attr(feature = "ts", ts(type = "string"))]
31551 pub uri: CharArray<160>,
31552 #[doc = "Encoding of stream."]
31553 #[cfg_attr(feature = "serde", serde(default))]
31554 pub encoding: VideoStreamEncoding,
31555 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
31556 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31557 pub camera_device_id: u8,
31558}
31559impl VIDEO_STREAM_INFORMATION_DATA {
31560 pub const ENCODED_LEN: usize = 215usize;
31561 pub const DEFAULT: Self = Self {
31562 framerate: 0.0_f32,
31563 bitrate: 0_u32,
31564 flags: VideoStreamStatusFlags::DEFAULT,
31565 resolution_h: 0_u16,
31566 resolution_v: 0_u16,
31567 rotation: 0_u16,
31568 hfov: 0_u16,
31569 stream_id: 0_u8,
31570 count: 0_u8,
31571 mavtype: VideoStreamType::DEFAULT,
31572 name: CharArray::new([0_u8; 32usize]),
31573 uri: CharArray::new([0_u8; 160usize]),
31574 encoding: VideoStreamEncoding::DEFAULT,
31575 camera_device_id: 0_u8,
31576 };
31577 #[cfg(feature = "arbitrary")]
31578 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31579 use arbitrary::{Arbitrary, Unstructured};
31580 let mut buf = [0u8; 1024];
31581 rng.fill_bytes(&mut buf);
31582 let mut unstructured = Unstructured::new(&buf);
31583 Self::arbitrary(&mut unstructured).unwrap_or_default()
31584 }
31585}
31586impl Default for VIDEO_STREAM_INFORMATION_DATA {
31587 fn default() -> Self {
31588 Self::DEFAULT.clone()
31589 }
31590}
31591impl MessageData for VIDEO_STREAM_INFORMATION_DATA {
31592 type Message = MavMessage;
31593 const ID: u32 = 269u32;
31594 const NAME: &'static str = "VIDEO_STREAM_INFORMATION";
31595 const EXTRA_CRC: u8 = 109u8;
31596 const ENCODED_LEN: usize = 215usize;
31597 fn deser(
31598 _version: MavlinkVersion,
31599 __input: &[u8],
31600 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31601 let avail_len = __input.len();
31602 let mut payload_buf = [0; Self::ENCODED_LEN];
31603 let mut buf = if avail_len < Self::ENCODED_LEN {
31604 payload_buf[0..avail_len].copy_from_slice(__input);
31605 Bytes::new(&payload_buf)
31606 } else {
31607 Bytes::new(__input)
31608 };
31609 let mut __struct = Self::default();
31610 __struct.framerate = buf.get_f32_le();
31611 __struct.bitrate = buf.get_u32_le();
31612 let tmp = buf.get_u16_le();
31613 __struct.flags = VideoStreamStatusFlags::from_bits(tmp).ok_or(
31614 ::mavlink_core::error::ParserError::InvalidFlag {
31615 flag_type: "VideoStreamStatusFlags",
31616 value: tmp as u64,
31617 },
31618 )?;
31619 __struct.resolution_h = buf.get_u16_le();
31620 __struct.resolution_v = buf.get_u16_le();
31621 __struct.rotation = buf.get_u16_le();
31622 __struct.hfov = buf.get_u16_le();
31623 __struct.stream_id = buf.get_u8();
31624 __struct.count = buf.get_u8();
31625 let tmp = buf.get_u8();
31626 __struct.mavtype =
31627 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31628 enum_type: "VideoStreamType",
31629 value: tmp as u64,
31630 })?;
31631 let mut tmp = [0_u8; 32usize];
31632 for v in &mut tmp {
31633 *v = buf.get_u8();
31634 }
31635 __struct.name = CharArray::new(tmp);
31636 let mut tmp = [0_u8; 160usize];
31637 for v in &mut tmp {
31638 *v = buf.get_u8();
31639 }
31640 __struct.uri = CharArray::new(tmp);
31641 let tmp = buf.get_u8();
31642 __struct.encoding =
31643 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31644 enum_type: "VideoStreamEncoding",
31645 value: tmp as u64,
31646 })?;
31647 __struct.camera_device_id = buf.get_u8();
31648 Ok(__struct)
31649 }
31650 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31651 let mut __tmp = BytesMut::new(bytes);
31652 #[allow(clippy::absurd_extreme_comparisons)]
31653 #[allow(unused_comparisons)]
31654 if __tmp.remaining() < Self::ENCODED_LEN {
31655 panic!(
31656 "buffer is too small (need {} bytes, but got {})",
31657 Self::ENCODED_LEN,
31658 __tmp.remaining(),
31659 )
31660 }
31661 __tmp.put_f32_le(self.framerate);
31662 __tmp.put_u32_le(self.bitrate);
31663 __tmp.put_u16_le(self.flags.bits());
31664 __tmp.put_u16_le(self.resolution_h);
31665 __tmp.put_u16_le(self.resolution_v);
31666 __tmp.put_u16_le(self.rotation);
31667 __tmp.put_u16_le(self.hfov);
31668 __tmp.put_u8(self.stream_id);
31669 __tmp.put_u8(self.count);
31670 __tmp.put_u8(self.mavtype as u8);
31671 for val in &self.name {
31672 __tmp.put_u8(*val);
31673 }
31674 for val in &self.uri {
31675 __tmp.put_u8(*val);
31676 }
31677 if matches!(version, MavlinkVersion::V2) {
31678 __tmp.put_u8(self.encoding as u8);
31679 __tmp.put_u8(self.camera_device_id);
31680 let len = __tmp.len();
31681 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31682 } else {
31683 __tmp.len()
31684 }
31685 }
31686}
31687#[doc = "Information about the status of a video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE."]
31688#[doc = ""]
31689#[doc = "ID: 270"]
31690#[derive(Debug, Clone, PartialEq)]
31691#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31692#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31693#[cfg_attr(feature = "ts", derive(TS))]
31694#[cfg_attr(feature = "ts", ts(export))]
31695pub struct VIDEO_STREAM_STATUS_DATA {
31696 #[doc = "Frame rate"]
31697 pub framerate: f32,
31698 #[doc = "Bit rate"]
31699 pub bitrate: u32,
31700 #[doc = "Bitmap of stream status flags"]
31701 pub flags: VideoStreamStatusFlags,
31702 #[doc = "Horizontal resolution"]
31703 pub resolution_h: u16,
31704 #[doc = "Vertical resolution"]
31705 pub resolution_v: u16,
31706 #[doc = "Video image rotation clockwise"]
31707 pub rotation: u16,
31708 #[doc = "Horizontal Field of view"]
31709 pub hfov: u16,
31710 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
31711 pub stream_id: u8,
31712 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
31713 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31714 pub camera_device_id: u8,
31715}
31716impl VIDEO_STREAM_STATUS_DATA {
31717 pub const ENCODED_LEN: usize = 20usize;
31718 pub const DEFAULT: Self = Self {
31719 framerate: 0.0_f32,
31720 bitrate: 0_u32,
31721 flags: VideoStreamStatusFlags::DEFAULT,
31722 resolution_h: 0_u16,
31723 resolution_v: 0_u16,
31724 rotation: 0_u16,
31725 hfov: 0_u16,
31726 stream_id: 0_u8,
31727 camera_device_id: 0_u8,
31728 };
31729 #[cfg(feature = "arbitrary")]
31730 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31731 use arbitrary::{Arbitrary, Unstructured};
31732 let mut buf = [0u8; 1024];
31733 rng.fill_bytes(&mut buf);
31734 let mut unstructured = Unstructured::new(&buf);
31735 Self::arbitrary(&mut unstructured).unwrap_or_default()
31736 }
31737}
31738impl Default for VIDEO_STREAM_STATUS_DATA {
31739 fn default() -> Self {
31740 Self::DEFAULT.clone()
31741 }
31742}
31743impl MessageData for VIDEO_STREAM_STATUS_DATA {
31744 type Message = MavMessage;
31745 const ID: u32 = 270u32;
31746 const NAME: &'static str = "VIDEO_STREAM_STATUS";
31747 const EXTRA_CRC: u8 = 59u8;
31748 const ENCODED_LEN: usize = 20usize;
31749 fn deser(
31750 _version: MavlinkVersion,
31751 __input: &[u8],
31752 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31753 let avail_len = __input.len();
31754 let mut payload_buf = [0; Self::ENCODED_LEN];
31755 let mut buf = if avail_len < Self::ENCODED_LEN {
31756 payload_buf[0..avail_len].copy_from_slice(__input);
31757 Bytes::new(&payload_buf)
31758 } else {
31759 Bytes::new(__input)
31760 };
31761 let mut __struct = Self::default();
31762 __struct.framerate = buf.get_f32_le();
31763 __struct.bitrate = buf.get_u32_le();
31764 let tmp = buf.get_u16_le();
31765 __struct.flags = VideoStreamStatusFlags::from_bits(tmp).ok_or(
31766 ::mavlink_core::error::ParserError::InvalidFlag {
31767 flag_type: "VideoStreamStatusFlags",
31768 value: tmp as u64,
31769 },
31770 )?;
31771 __struct.resolution_h = buf.get_u16_le();
31772 __struct.resolution_v = buf.get_u16_le();
31773 __struct.rotation = buf.get_u16_le();
31774 __struct.hfov = buf.get_u16_le();
31775 __struct.stream_id = buf.get_u8();
31776 __struct.camera_device_id = buf.get_u8();
31777 Ok(__struct)
31778 }
31779 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31780 let mut __tmp = BytesMut::new(bytes);
31781 #[allow(clippy::absurd_extreme_comparisons)]
31782 #[allow(unused_comparisons)]
31783 if __tmp.remaining() < Self::ENCODED_LEN {
31784 panic!(
31785 "buffer is too small (need {} bytes, but got {})",
31786 Self::ENCODED_LEN,
31787 __tmp.remaining(),
31788 )
31789 }
31790 __tmp.put_f32_le(self.framerate);
31791 __tmp.put_u32_le(self.bitrate);
31792 __tmp.put_u16_le(self.flags.bits());
31793 __tmp.put_u16_le(self.resolution_h);
31794 __tmp.put_u16_le(self.resolution_v);
31795 __tmp.put_u16_le(self.rotation);
31796 __tmp.put_u16_le(self.hfov);
31797 __tmp.put_u8(self.stream_id);
31798 if matches!(version, MavlinkVersion::V2) {
31799 __tmp.put_u8(self.camera_device_id);
31800 let len = __tmp.len();
31801 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31802 } else {
31803 __tmp.len()
31804 }
31805 }
31806}
31807#[doc = "Local position/attitude estimate from a vision source."]
31808#[doc = ""]
31809#[doc = "ID: 102"]
31810#[derive(Debug, Clone, PartialEq)]
31811#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31812#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31813#[cfg_attr(feature = "ts", derive(TS))]
31814#[cfg_attr(feature = "ts", ts(export))]
31815pub struct VISION_POSITION_ESTIMATE_DATA {
31816 #[doc = "Timestamp (UNIX time or time since system boot)"]
31817 pub usec: u64,
31818 #[doc = "Local X position"]
31819 pub x: f32,
31820 #[doc = "Local Y position"]
31821 pub y: f32,
31822 #[doc = "Local Z position"]
31823 pub z: f32,
31824 #[doc = "Roll angle"]
31825 pub roll: f32,
31826 #[doc = "Pitch angle"]
31827 pub pitch: f32,
31828 #[doc = "Yaw angle"]
31829 pub yaw: f32,
31830 #[doc = "Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
31831 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31832 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31833 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
31834 pub covariance: [f32; 21],
31835 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
31836 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31837 pub reset_counter: u8,
31838}
31839impl VISION_POSITION_ESTIMATE_DATA {
31840 pub const ENCODED_LEN: usize = 117usize;
31841 pub const DEFAULT: Self = Self {
31842 usec: 0_u64,
31843 x: 0.0_f32,
31844 y: 0.0_f32,
31845 z: 0.0_f32,
31846 roll: 0.0_f32,
31847 pitch: 0.0_f32,
31848 yaw: 0.0_f32,
31849 covariance: [0.0_f32; 21usize],
31850 reset_counter: 0_u8,
31851 };
31852 #[cfg(feature = "arbitrary")]
31853 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31854 use arbitrary::{Arbitrary, Unstructured};
31855 let mut buf = [0u8; 1024];
31856 rng.fill_bytes(&mut buf);
31857 let mut unstructured = Unstructured::new(&buf);
31858 Self::arbitrary(&mut unstructured).unwrap_or_default()
31859 }
31860}
31861impl Default for VISION_POSITION_ESTIMATE_DATA {
31862 fn default() -> Self {
31863 Self::DEFAULT.clone()
31864 }
31865}
31866impl MessageData for VISION_POSITION_ESTIMATE_DATA {
31867 type Message = MavMessage;
31868 const ID: u32 = 102u32;
31869 const NAME: &'static str = "VISION_POSITION_ESTIMATE";
31870 const EXTRA_CRC: u8 = 158u8;
31871 const ENCODED_LEN: usize = 117usize;
31872 fn deser(
31873 _version: MavlinkVersion,
31874 __input: &[u8],
31875 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31876 let avail_len = __input.len();
31877 let mut payload_buf = [0; Self::ENCODED_LEN];
31878 let mut buf = if avail_len < Self::ENCODED_LEN {
31879 payload_buf[0..avail_len].copy_from_slice(__input);
31880 Bytes::new(&payload_buf)
31881 } else {
31882 Bytes::new(__input)
31883 };
31884 let mut __struct = Self::default();
31885 __struct.usec = buf.get_u64_le();
31886 __struct.x = buf.get_f32_le();
31887 __struct.y = buf.get_f32_le();
31888 __struct.z = buf.get_f32_le();
31889 __struct.roll = buf.get_f32_le();
31890 __struct.pitch = buf.get_f32_le();
31891 __struct.yaw = buf.get_f32_le();
31892 for v in &mut __struct.covariance {
31893 let val = buf.get_f32_le();
31894 *v = val;
31895 }
31896 __struct.reset_counter = buf.get_u8();
31897 Ok(__struct)
31898 }
31899 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31900 let mut __tmp = BytesMut::new(bytes);
31901 #[allow(clippy::absurd_extreme_comparisons)]
31902 #[allow(unused_comparisons)]
31903 if __tmp.remaining() < Self::ENCODED_LEN {
31904 panic!(
31905 "buffer is too small (need {} bytes, but got {})",
31906 Self::ENCODED_LEN,
31907 __tmp.remaining(),
31908 )
31909 }
31910 __tmp.put_u64_le(self.usec);
31911 __tmp.put_f32_le(self.x);
31912 __tmp.put_f32_le(self.y);
31913 __tmp.put_f32_le(self.z);
31914 __tmp.put_f32_le(self.roll);
31915 __tmp.put_f32_le(self.pitch);
31916 __tmp.put_f32_le(self.yaw);
31917 if matches!(version, MavlinkVersion::V2) {
31918 for val in &self.covariance {
31919 __tmp.put_f32_le(*val);
31920 }
31921 __tmp.put_u8(self.reset_counter);
31922 let len = __tmp.len();
31923 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31924 } else {
31925 __tmp.len()
31926 }
31927 }
31928}
31929#[doc = "Speed estimate from a vision source."]
31930#[doc = ""]
31931#[doc = "ID: 103"]
31932#[derive(Debug, Clone, PartialEq)]
31933#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31934#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31935#[cfg_attr(feature = "ts", derive(TS))]
31936#[cfg_attr(feature = "ts", ts(export))]
31937pub struct VISION_SPEED_ESTIMATE_DATA {
31938 #[doc = "Timestamp (UNIX time or time since system boot)"]
31939 pub usec: u64,
31940 #[doc = "Global X speed"]
31941 pub x: f32,
31942 #[doc = "Global Y speed"]
31943 pub y: f32,
31944 #[doc = "Global Z speed"]
31945 pub z: f32,
31946 #[doc = "Row-major representation of 3x3 linear velocity covariance matrix (states: vx, vy, vz; 1st three entries - 1st row, etc.). If unknown, assign NaN value to first element in the array."]
31947 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31948 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31949 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
31950 pub covariance: [f32; 9],
31951 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
31952 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31953 pub reset_counter: u8,
31954}
31955impl VISION_SPEED_ESTIMATE_DATA {
31956 pub const ENCODED_LEN: usize = 57usize;
31957 pub const DEFAULT: Self = Self {
31958 usec: 0_u64,
31959 x: 0.0_f32,
31960 y: 0.0_f32,
31961 z: 0.0_f32,
31962 covariance: [0.0_f32; 9usize],
31963 reset_counter: 0_u8,
31964 };
31965 #[cfg(feature = "arbitrary")]
31966 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31967 use arbitrary::{Arbitrary, Unstructured};
31968 let mut buf = [0u8; 1024];
31969 rng.fill_bytes(&mut buf);
31970 let mut unstructured = Unstructured::new(&buf);
31971 Self::arbitrary(&mut unstructured).unwrap_or_default()
31972 }
31973}
31974impl Default for VISION_SPEED_ESTIMATE_DATA {
31975 fn default() -> Self {
31976 Self::DEFAULT.clone()
31977 }
31978}
31979impl MessageData for VISION_SPEED_ESTIMATE_DATA {
31980 type Message = MavMessage;
31981 const ID: u32 = 103u32;
31982 const NAME: &'static str = "VISION_SPEED_ESTIMATE";
31983 const EXTRA_CRC: u8 = 208u8;
31984 const ENCODED_LEN: usize = 57usize;
31985 fn deser(
31986 _version: MavlinkVersion,
31987 __input: &[u8],
31988 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31989 let avail_len = __input.len();
31990 let mut payload_buf = [0; Self::ENCODED_LEN];
31991 let mut buf = if avail_len < Self::ENCODED_LEN {
31992 payload_buf[0..avail_len].copy_from_slice(__input);
31993 Bytes::new(&payload_buf)
31994 } else {
31995 Bytes::new(__input)
31996 };
31997 let mut __struct = Self::default();
31998 __struct.usec = buf.get_u64_le();
31999 __struct.x = buf.get_f32_le();
32000 __struct.y = buf.get_f32_le();
32001 __struct.z = buf.get_f32_le();
32002 for v in &mut __struct.covariance {
32003 let val = buf.get_f32_le();
32004 *v = val;
32005 }
32006 __struct.reset_counter = buf.get_u8();
32007 Ok(__struct)
32008 }
32009 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32010 let mut __tmp = BytesMut::new(bytes);
32011 #[allow(clippy::absurd_extreme_comparisons)]
32012 #[allow(unused_comparisons)]
32013 if __tmp.remaining() < Self::ENCODED_LEN {
32014 panic!(
32015 "buffer is too small (need {} bytes, but got {})",
32016 Self::ENCODED_LEN,
32017 __tmp.remaining(),
32018 )
32019 }
32020 __tmp.put_u64_le(self.usec);
32021 __tmp.put_f32_le(self.x);
32022 __tmp.put_f32_le(self.y);
32023 __tmp.put_f32_le(self.z);
32024 if matches!(version, MavlinkVersion::V2) {
32025 for val in &self.covariance {
32026 __tmp.put_f32_le(*val);
32027 }
32028 __tmp.put_u8(self.reset_counter);
32029 let len = __tmp.len();
32030 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32031 } else {
32032 __tmp.len()
32033 }
32034 }
32035}
32036#[doc = "Cumulative distance traveled for each reported wheel."]
32037#[doc = ""]
32038#[doc = "ID: 9000"]
32039#[derive(Debug, Clone, PartialEq)]
32040#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32041#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32042#[cfg_attr(feature = "ts", derive(TS))]
32043#[cfg_attr(feature = "ts", ts(export))]
32044pub struct WHEEL_DISTANCE_DATA {
32045 #[doc = "Timestamp (synced to UNIX time or since system boot)."]
32046 pub time_usec: u64,
32047 #[doc = "Distance reported by individual wheel encoders. Forward rotations increase values, reverse rotations decrease them. Not all wheels will necessarily have wheel encoders; the mapping of encoders to wheel positions must be agreed/understood by the endpoints."]
32048 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32049 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32050 pub distance: [f64; 16],
32051 #[doc = "Number of wheels reported."]
32052 pub count: u8,
32053}
32054impl WHEEL_DISTANCE_DATA {
32055 pub const ENCODED_LEN: usize = 137usize;
32056 pub const DEFAULT: Self = Self {
32057 time_usec: 0_u64,
32058 distance: [0.0_f64; 16usize],
32059 count: 0_u8,
32060 };
32061 #[cfg(feature = "arbitrary")]
32062 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32063 use arbitrary::{Arbitrary, Unstructured};
32064 let mut buf = [0u8; 1024];
32065 rng.fill_bytes(&mut buf);
32066 let mut unstructured = Unstructured::new(&buf);
32067 Self::arbitrary(&mut unstructured).unwrap_or_default()
32068 }
32069}
32070impl Default for WHEEL_DISTANCE_DATA {
32071 fn default() -> Self {
32072 Self::DEFAULT.clone()
32073 }
32074}
32075impl MessageData for WHEEL_DISTANCE_DATA {
32076 type Message = MavMessage;
32077 const ID: u32 = 9000u32;
32078 const NAME: &'static str = "WHEEL_DISTANCE";
32079 const EXTRA_CRC: u8 = 113u8;
32080 const ENCODED_LEN: usize = 137usize;
32081 fn deser(
32082 _version: MavlinkVersion,
32083 __input: &[u8],
32084 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32085 let avail_len = __input.len();
32086 let mut payload_buf = [0; Self::ENCODED_LEN];
32087 let mut buf = if avail_len < Self::ENCODED_LEN {
32088 payload_buf[0..avail_len].copy_from_slice(__input);
32089 Bytes::new(&payload_buf)
32090 } else {
32091 Bytes::new(__input)
32092 };
32093 let mut __struct = Self::default();
32094 __struct.time_usec = buf.get_u64_le();
32095 for v in &mut __struct.distance {
32096 let val = buf.get_f64_le();
32097 *v = val;
32098 }
32099 __struct.count = buf.get_u8();
32100 Ok(__struct)
32101 }
32102 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32103 let mut __tmp = BytesMut::new(bytes);
32104 #[allow(clippy::absurd_extreme_comparisons)]
32105 #[allow(unused_comparisons)]
32106 if __tmp.remaining() < Self::ENCODED_LEN {
32107 panic!(
32108 "buffer is too small (need {} bytes, but got {})",
32109 Self::ENCODED_LEN,
32110 __tmp.remaining(),
32111 )
32112 }
32113 __tmp.put_u64_le(self.time_usec);
32114 for val in &self.distance {
32115 __tmp.put_f64_le(*val);
32116 }
32117 __tmp.put_u8(self.count);
32118 if matches!(version, MavlinkVersion::V2) {
32119 let len = __tmp.len();
32120 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32121 } else {
32122 __tmp.len()
32123 }
32124 }
32125}
32126#[doc = "Configure WiFi AP SSID, password, and mode. This message is re-emitted as an acknowledgement by the AP. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
32127#[doc = ""]
32128#[doc = "ID: 299"]
32129#[derive(Debug, Clone, PartialEq)]
32130#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32131#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32132#[cfg_attr(feature = "ts", derive(TS))]
32133#[cfg_attr(feature = "ts", ts(export))]
32134pub struct WIFI_CONFIG_AP_DATA {
32135 #[doc = "Name of Wi-Fi network (SSID). Blank to leave it unchanged when setting. Current SSID when sent back as a response."]
32136 #[cfg_attr(feature = "ts", ts(type = "string"))]
32137 pub ssid: CharArray<32>,
32138 #[doc = "Password. Blank for an open AP. MD5 hash when message is sent back as a response."]
32139 #[cfg_attr(feature = "ts", ts(type = "string"))]
32140 pub password: CharArray<64>,
32141 #[doc = "WiFi Mode."]
32142 #[cfg_attr(feature = "serde", serde(default))]
32143 pub mode: WifiConfigApMode,
32144 #[doc = "Message acceptance response (sent back to GS)."]
32145 #[cfg_attr(feature = "serde", serde(default))]
32146 pub response: WifiConfigApResponse,
32147}
32148impl WIFI_CONFIG_AP_DATA {
32149 pub const ENCODED_LEN: usize = 98usize;
32150 pub const DEFAULT: Self = Self {
32151 ssid: CharArray::new([0_u8; 32usize]),
32152 password: CharArray::new([0_u8; 64usize]),
32153 mode: WifiConfigApMode::DEFAULT,
32154 response: WifiConfigApResponse::DEFAULT,
32155 };
32156 #[cfg(feature = "arbitrary")]
32157 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32158 use arbitrary::{Arbitrary, Unstructured};
32159 let mut buf = [0u8; 1024];
32160 rng.fill_bytes(&mut buf);
32161 let mut unstructured = Unstructured::new(&buf);
32162 Self::arbitrary(&mut unstructured).unwrap_or_default()
32163 }
32164}
32165impl Default for WIFI_CONFIG_AP_DATA {
32166 fn default() -> Self {
32167 Self::DEFAULT.clone()
32168 }
32169}
32170impl MessageData for WIFI_CONFIG_AP_DATA {
32171 type Message = MavMessage;
32172 const ID: u32 = 299u32;
32173 const NAME: &'static str = "WIFI_CONFIG_AP";
32174 const EXTRA_CRC: u8 = 19u8;
32175 const ENCODED_LEN: usize = 98usize;
32176 fn deser(
32177 _version: MavlinkVersion,
32178 __input: &[u8],
32179 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32180 let avail_len = __input.len();
32181 let mut payload_buf = [0; Self::ENCODED_LEN];
32182 let mut buf = if avail_len < Self::ENCODED_LEN {
32183 payload_buf[0..avail_len].copy_from_slice(__input);
32184 Bytes::new(&payload_buf)
32185 } else {
32186 Bytes::new(__input)
32187 };
32188 let mut __struct = Self::default();
32189 let mut tmp = [0_u8; 32usize];
32190 for v in &mut tmp {
32191 *v = buf.get_u8();
32192 }
32193 __struct.ssid = CharArray::new(tmp);
32194 let mut tmp = [0_u8; 64usize];
32195 for v in &mut tmp {
32196 *v = buf.get_u8();
32197 }
32198 __struct.password = CharArray::new(tmp);
32199 let tmp = buf.get_i8();
32200 __struct.mode =
32201 FromPrimitive::from_i8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
32202 enum_type: "WifiConfigApMode",
32203 value: tmp as u64,
32204 })?;
32205 let tmp = buf.get_i8();
32206 __struct.response =
32207 FromPrimitive::from_i8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
32208 enum_type: "WifiConfigApResponse",
32209 value: tmp as u64,
32210 })?;
32211 Ok(__struct)
32212 }
32213 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32214 let mut __tmp = BytesMut::new(bytes);
32215 #[allow(clippy::absurd_extreme_comparisons)]
32216 #[allow(unused_comparisons)]
32217 if __tmp.remaining() < Self::ENCODED_LEN {
32218 panic!(
32219 "buffer is too small (need {} bytes, but got {})",
32220 Self::ENCODED_LEN,
32221 __tmp.remaining(),
32222 )
32223 }
32224 for val in &self.ssid {
32225 __tmp.put_u8(*val);
32226 }
32227 for val in &self.password {
32228 __tmp.put_u8(*val);
32229 }
32230 if matches!(version, MavlinkVersion::V2) {
32231 __tmp.put_i8(self.mode as i8);
32232 __tmp.put_i8(self.response as i8);
32233 let len = __tmp.len();
32234 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32235 } else {
32236 __tmp.len()
32237 }
32238 }
32239}
32240#[doc = "Winch status."]
32241#[doc = ""]
32242#[doc = "ID: 9005"]
32243#[derive(Debug, Clone, PartialEq)]
32244#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32245#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32246#[cfg_attr(feature = "ts", derive(TS))]
32247#[cfg_attr(feature = "ts", ts(export))]
32248pub struct WINCH_STATUS_DATA {
32249 #[doc = "Timestamp (synced to UNIX time or since system boot)."]
32250 pub time_usec: u64,
32251 #[doc = "Length of line released. NaN if unknown"]
32252 pub line_length: f32,
32253 #[doc = "Speed line is being released or retracted. Positive values if being released, negative values if being retracted, NaN if unknown"]
32254 pub speed: f32,
32255 #[doc = "Tension on the line. NaN if unknown"]
32256 pub tension: f32,
32257 #[doc = "Voltage of the battery supplying the winch. NaN if unknown"]
32258 pub voltage: f32,
32259 #[doc = "Current draw from the winch. NaN if unknown"]
32260 pub current: f32,
32261 #[doc = "Status flags"]
32262 pub status: MavWinchStatusFlag,
32263 #[doc = "Temperature of the motor. INT16_MAX if unknown"]
32264 pub temperature: i16,
32265}
32266impl WINCH_STATUS_DATA {
32267 pub const ENCODED_LEN: usize = 34usize;
32268 pub const DEFAULT: Self = Self {
32269 time_usec: 0_u64,
32270 line_length: 0.0_f32,
32271 speed: 0.0_f32,
32272 tension: 0.0_f32,
32273 voltage: 0.0_f32,
32274 current: 0.0_f32,
32275 status: MavWinchStatusFlag::DEFAULT,
32276 temperature: 0_i16,
32277 };
32278 #[cfg(feature = "arbitrary")]
32279 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32280 use arbitrary::{Arbitrary, Unstructured};
32281 let mut buf = [0u8; 1024];
32282 rng.fill_bytes(&mut buf);
32283 let mut unstructured = Unstructured::new(&buf);
32284 Self::arbitrary(&mut unstructured).unwrap_or_default()
32285 }
32286}
32287impl Default for WINCH_STATUS_DATA {
32288 fn default() -> Self {
32289 Self::DEFAULT.clone()
32290 }
32291}
32292impl MessageData for WINCH_STATUS_DATA {
32293 type Message = MavMessage;
32294 const ID: u32 = 9005u32;
32295 const NAME: &'static str = "WINCH_STATUS";
32296 const EXTRA_CRC: u8 = 117u8;
32297 const ENCODED_LEN: usize = 34usize;
32298 fn deser(
32299 _version: MavlinkVersion,
32300 __input: &[u8],
32301 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32302 let avail_len = __input.len();
32303 let mut payload_buf = [0; Self::ENCODED_LEN];
32304 let mut buf = if avail_len < Self::ENCODED_LEN {
32305 payload_buf[0..avail_len].copy_from_slice(__input);
32306 Bytes::new(&payload_buf)
32307 } else {
32308 Bytes::new(__input)
32309 };
32310 let mut __struct = Self::default();
32311 __struct.time_usec = buf.get_u64_le();
32312 __struct.line_length = buf.get_f32_le();
32313 __struct.speed = buf.get_f32_le();
32314 __struct.tension = buf.get_f32_le();
32315 __struct.voltage = buf.get_f32_le();
32316 __struct.current = buf.get_f32_le();
32317 let tmp = buf.get_u32_le();
32318 __struct.status = MavWinchStatusFlag::from_bits(tmp).ok_or(
32319 ::mavlink_core::error::ParserError::InvalidFlag {
32320 flag_type: "MavWinchStatusFlag",
32321 value: tmp as u64,
32322 },
32323 )?;
32324 __struct.temperature = buf.get_i16_le();
32325 Ok(__struct)
32326 }
32327 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32328 let mut __tmp = BytesMut::new(bytes);
32329 #[allow(clippy::absurd_extreme_comparisons)]
32330 #[allow(unused_comparisons)]
32331 if __tmp.remaining() < Self::ENCODED_LEN {
32332 panic!(
32333 "buffer is too small (need {} bytes, but got {})",
32334 Self::ENCODED_LEN,
32335 __tmp.remaining(),
32336 )
32337 }
32338 __tmp.put_u64_le(self.time_usec);
32339 __tmp.put_f32_le(self.line_length);
32340 __tmp.put_f32_le(self.speed);
32341 __tmp.put_f32_le(self.tension);
32342 __tmp.put_f32_le(self.voltage);
32343 __tmp.put_f32_le(self.current);
32344 __tmp.put_u32_le(self.status.bits());
32345 __tmp.put_i16_le(self.temperature);
32346 if matches!(version, MavlinkVersion::V2) {
32347 let len = __tmp.len();
32348 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32349 } else {
32350 __tmp.len()
32351 }
32352 }
32353}
32354#[doc = "Wind estimate from vehicle. Note that despite the name, this message does not actually contain any covariances but instead variability and accuracy fields in terms of standard deviation (1-STD)."]
32355#[doc = ""]
32356#[doc = "ID: 231"]
32357#[derive(Debug, Clone, PartialEq)]
32358#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32359#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32360#[cfg_attr(feature = "ts", derive(TS))]
32361#[cfg_attr(feature = "ts", ts(export))]
32362pub struct WIND_COV_DATA {
32363 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
32364 pub time_usec: u64,
32365 #[doc = "Wind in North (NED) direction (NAN if unknown)"]
32366 pub wind_x: f32,
32367 #[doc = "Wind in East (NED) direction (NAN if unknown)"]
32368 pub wind_y: f32,
32369 #[doc = "Wind in down (NED) direction (NAN if unknown)"]
32370 pub wind_z: f32,
32371 #[doc = "Variability of wind in XY, 1-STD estimated from a 1 Hz lowpassed wind estimate (NAN if unknown)"]
32372 pub var_horiz: f32,
32373 #[doc = "Variability of wind in Z, 1-STD estimated from a 1 Hz lowpassed wind estimate (NAN if unknown)"]
32374 pub var_vert: f32,
32375 #[doc = "Altitude (MSL) that this measurement was taken at (NAN if unknown)"]
32376 pub wind_alt: f32,
32377 #[doc = "Horizontal speed 1-STD accuracy (0 if unknown)"]
32378 pub horiz_accuracy: f32,
32379 #[doc = "Vertical speed 1-STD accuracy (0 if unknown)"]
32380 pub vert_accuracy: f32,
32381}
32382impl WIND_COV_DATA {
32383 pub const ENCODED_LEN: usize = 40usize;
32384 pub const DEFAULT: Self = Self {
32385 time_usec: 0_u64,
32386 wind_x: 0.0_f32,
32387 wind_y: 0.0_f32,
32388 wind_z: 0.0_f32,
32389 var_horiz: 0.0_f32,
32390 var_vert: 0.0_f32,
32391 wind_alt: 0.0_f32,
32392 horiz_accuracy: 0.0_f32,
32393 vert_accuracy: 0.0_f32,
32394 };
32395 #[cfg(feature = "arbitrary")]
32396 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32397 use arbitrary::{Arbitrary, Unstructured};
32398 let mut buf = [0u8; 1024];
32399 rng.fill_bytes(&mut buf);
32400 let mut unstructured = Unstructured::new(&buf);
32401 Self::arbitrary(&mut unstructured).unwrap_or_default()
32402 }
32403}
32404impl Default for WIND_COV_DATA {
32405 fn default() -> Self {
32406 Self::DEFAULT.clone()
32407 }
32408}
32409impl MessageData for WIND_COV_DATA {
32410 type Message = MavMessage;
32411 const ID: u32 = 231u32;
32412 const NAME: &'static str = "WIND_COV";
32413 const EXTRA_CRC: u8 = 105u8;
32414 const ENCODED_LEN: usize = 40usize;
32415 fn deser(
32416 _version: MavlinkVersion,
32417 __input: &[u8],
32418 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32419 let avail_len = __input.len();
32420 let mut payload_buf = [0; Self::ENCODED_LEN];
32421 let mut buf = if avail_len < Self::ENCODED_LEN {
32422 payload_buf[0..avail_len].copy_from_slice(__input);
32423 Bytes::new(&payload_buf)
32424 } else {
32425 Bytes::new(__input)
32426 };
32427 let mut __struct = Self::default();
32428 __struct.time_usec = buf.get_u64_le();
32429 __struct.wind_x = buf.get_f32_le();
32430 __struct.wind_y = buf.get_f32_le();
32431 __struct.wind_z = buf.get_f32_le();
32432 __struct.var_horiz = buf.get_f32_le();
32433 __struct.var_vert = buf.get_f32_le();
32434 __struct.wind_alt = buf.get_f32_le();
32435 __struct.horiz_accuracy = buf.get_f32_le();
32436 __struct.vert_accuracy = buf.get_f32_le();
32437 Ok(__struct)
32438 }
32439 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32440 let mut __tmp = BytesMut::new(bytes);
32441 #[allow(clippy::absurd_extreme_comparisons)]
32442 #[allow(unused_comparisons)]
32443 if __tmp.remaining() < Self::ENCODED_LEN {
32444 panic!(
32445 "buffer is too small (need {} bytes, but got {})",
32446 Self::ENCODED_LEN,
32447 __tmp.remaining(),
32448 )
32449 }
32450 __tmp.put_u64_le(self.time_usec);
32451 __tmp.put_f32_le(self.wind_x);
32452 __tmp.put_f32_le(self.wind_y);
32453 __tmp.put_f32_le(self.wind_z);
32454 __tmp.put_f32_le(self.var_horiz);
32455 __tmp.put_f32_le(self.var_vert);
32456 __tmp.put_f32_le(self.wind_alt);
32457 __tmp.put_f32_le(self.horiz_accuracy);
32458 __tmp.put_f32_le(self.vert_accuracy);
32459 if matches!(version, MavlinkVersion::V2) {
32460 let len = __tmp.len();
32461 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32462 } else {
32463 __tmp.len()
32464 }
32465 }
32466}
32467#[derive(Clone, PartialEq, Debug)]
32468#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32469#[cfg_attr(feature = "serde", serde(tag = "type"))]
32470#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32471#[cfg_attr(feature = "ts", derive(TS))]
32472#[cfg_attr(feature = "ts", ts(export))]
32473#[repr(u32)]
32474pub enum MavMessage {
32475 #[doc = "Set the vehicle attitude and body angular rates."]
32476 #[doc = ""]
32477 #[doc = "ID: 140"]
32478 ACTUATOR_CONTROL_TARGET(ACTUATOR_CONTROL_TARGET_DATA),
32479 #[doc = "The raw values of the actuator outputs (e.g. on Pixhawk, from MAIN, AUX ports). This message supersedes SERVO_OUTPUT_RAW."]
32480 #[doc = ""]
32481 #[doc = "ID: 375"]
32482 ACTUATOR_OUTPUT_STATUS(ACTUATOR_OUTPUT_STATUS_DATA),
32483 #[doc = "The location and information of an ADSB vehicle."]
32484 #[doc = ""]
32485 #[doc = "ID: 246"]
32486 ADSB_VEHICLE(ADSB_VEHICLE_DATA),
32487 #[doc = "The location and information of an AIS vessel."]
32488 #[doc = ""]
32489 #[doc = "ID: 301"]
32490 AIS_VESSEL(AIS_VESSEL_DATA),
32491 #[doc = "The current system altitude."]
32492 #[doc = ""]
32493 #[doc = "ID: 141"]
32494 ALTITUDE(ALTITUDE_DATA),
32495 #[doc = "The attitude in the aeronautical frame (right-handed, Z-down, Y-right, X-front, ZYX, intrinsic)."]
32496 #[doc = ""]
32497 #[doc = "ID: 30"]
32498 ATTITUDE(ATTITUDE_DATA),
32499 #[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
32500 #[doc = ""]
32501 #[doc = "ID: 31"]
32502 ATTITUDE_QUATERNION(ATTITUDE_QUATERNION_DATA),
32503 #[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
32504 #[doc = ""]
32505 #[doc = "ID: 61"]
32506 ATTITUDE_QUATERNION_COV(ATTITUDE_QUATERNION_COV_DATA),
32507 #[doc = "Reports the current commanded attitude of the vehicle as specified by the autopilot. This should match the commands sent in a SET_ATTITUDE_TARGET message if the vehicle is being controlled this way."]
32508 #[doc = ""]
32509 #[doc = "ID: 83"]
32510 ATTITUDE_TARGET(ATTITUDE_TARGET_DATA),
32511 #[doc = "Motion capture attitude and position."]
32512 #[doc = ""]
32513 #[doc = "ID: 138"]
32514 ATT_POS_MOCAP(ATT_POS_MOCAP_DATA),
32515 #[doc = "Emit an encrypted signature / key identifying this system. PLEASE NOTE: This protocol has been kept simple, so transmitting the key requires an encrypted channel for true safety."]
32516 #[doc = ""]
32517 #[doc = "ID: 7"]
32518 AUTH_KEY(AUTH_KEY_DATA),
32519 #[doc = "Low level message containing autopilot state relevant for a gimbal device. This message is to be sent from the autopilot to the gimbal device component. The data of this message are for the gimbal device's estimator corrections, in particular horizon compensation, as well as indicates autopilot control intentions, e.g. feed forward angular control in the z-axis."]
32520 #[doc = ""]
32521 #[doc = "ID: 286"]
32522 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA),
32523 #[doc = "Version and capability of autopilot software. This should be emitted in response to a request with MAV_CMD_REQUEST_MESSAGE."]
32524 #[doc = ""]
32525 #[doc = "ID: 148"]
32526 AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA),
32527 #[doc = "Information about a flight mode. The message can be enumerated to get information for all modes, or requested for a particular mode, using MAV_CMD_REQUEST_MESSAGE. Specify 0 in param2 to request that the message is emitted for all available modes or the specific index for just one mode. The modes must be available/settable for the current vehicle/frame type. Each mode should only be emitted once (even if it is both standard and custom). Note that the current mode should be emitted in CURRENT_MODE, and that if the mode list can change then AVAILABLE_MODES_MONITOR must be emitted on first change and subsequently streamed. See <https://mavlink.io/en/services/standard_modes.html>."]
32528 #[doc = ""]
32529 #[doc = "ID: 435"]
32530 AVAILABLE_MODES(AVAILABLE_MODES_DATA),
32531 #[doc = "A change to the sequence number indicates that the set of AVAILABLE_MODES has changed. A receiver must re-request all available modes whenever the sequence number changes. This is only emitted after the first change and should then be broadcast at low rate (nominally 0.3 Hz) and on change. See <https://mavlink.io/en/services/standard_modes.html>."]
32532 #[doc = ""]
32533 #[doc = "ID: 437"]
32534 AVAILABLE_MODES_MONITOR(AVAILABLE_MODES_MONITOR_DATA),
32535 #[doc = "Battery information that is static, or requires infrequent update. This message should requested using MAV_CMD_REQUEST_MESSAGE and/or streamed at very low rate. BATTERY_STATUS_V2 is used for higher-rate battery status information."]
32536 #[doc = ""]
32537 #[doc = "ID: 372"]
32538 BATTERY_INFO(BATTERY_INFO_DATA),
32539 #[doc = "Battery information. Updates GCS with flight controller battery status. Smart batteries also use this message, but may additionally send BATTERY_INFO."]
32540 #[doc = ""]
32541 #[doc = "ID: 147"]
32542 BATTERY_STATUS(BATTERY_STATUS_DATA),
32543 #[doc = "Report button state change."]
32544 #[doc = ""]
32545 #[doc = "ID: 257"]
32546 BUTTON_CHANGE(BUTTON_CHANGE_DATA),
32547 #[doc = "Information about the status of a capture. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
32548 #[doc = ""]
32549 #[doc = "ID: 262"]
32550 CAMERA_CAPTURE_STATUS(CAMERA_CAPTURE_STATUS_DATA),
32551 #[doc = "Information about the field of view of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
32552 #[doc = ""]
32553 #[doc = "ID: 271"]
32554 CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA),
32555 #[doc = "Information about a captured image. This is emitted every time a message is captured. MAV_CMD_REQUEST_MESSAGE can be used to (re)request this message for a specific sequence number or range of sequence numbers: MAV_CMD_REQUEST_MESSAGE.param2 indicates the sequence number the first image to send, or set to -1 to send the message for all sequence numbers. MAV_CMD_REQUEST_MESSAGE.param3 is used to specify a range of messages to send: set to 0 (default) to send just the the message for the sequence number in param 2, set to -1 to send the message for the sequence number in param 2 and all the following sequence numbers, set to the sequence number of the final message in the range."]
32556 #[doc = ""]
32557 #[doc = "ID: 263"]
32558 CAMERA_IMAGE_CAPTURED(CAMERA_IMAGE_CAPTURED_DATA),
32559 #[doc = "Information about a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
32560 #[doc = ""]
32561 #[doc = "ID: 259"]
32562 CAMERA_INFORMATION(CAMERA_INFORMATION_DATA),
32563 #[doc = "Settings of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
32564 #[doc = ""]
32565 #[doc = "ID: 260"]
32566 CAMERA_SETTINGS(CAMERA_SETTINGS_DATA),
32567 #[doc = "Camera absolute thermal range. This can be streamed when the associated VIDEO_STREAM_STATUS `flag` field bit VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED is set, but a GCS may choose to only request it for the current active stream. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval (param3 indicates the stream id of the current camera, or 0 for all streams, param4 indicates the target camera_device_id for autopilot-attached cameras or 0 for MAVLink cameras)."]
32568 #[doc = ""]
32569 #[doc = "ID: 277"]
32570 CAMERA_THERMAL_RANGE(CAMERA_THERMAL_RANGE_DATA),
32571 #[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
32572 #[doc = ""]
32573 #[doc = "ID: 276"]
32574 CAMERA_TRACKING_GEO_STATUS(CAMERA_TRACKING_GEO_STATUS_DATA),
32575 #[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
32576 #[doc = ""]
32577 #[doc = "ID: 275"]
32578 CAMERA_TRACKING_IMAGE_STATUS(CAMERA_TRACKING_IMAGE_STATUS_DATA),
32579 #[doc = "Camera-IMU triggering and synchronisation message."]
32580 #[doc = ""]
32581 #[doc = "ID: 112"]
32582 CAMERA_TRIGGER(CAMERA_TRIGGER_DATA),
32583 #[doc = "A forwarded CANFD frame as requested by MAV_CMD_CAN_FORWARD. These are separated from CAN_FRAME as they need different handling (eg. TAO handling)."]
32584 #[doc = ""]
32585 #[doc = "ID: 387"]
32586 CANFD_FRAME(CANFD_FRAME_DATA),
32587 #[doc = "Modify the filter of what CAN messages to forward over the mavlink. This can be used to make CAN forwarding work well on low bandwidth links. The filtering is applied on bits 8 to 24 of the CAN id (2nd and 3rd bytes) which corresponds to the DroneCAN message ID for DroneCAN. Filters with more than 16 IDs can be constructed by sending multiple CAN_FILTER_MODIFY messages."]
32588 #[doc = ""]
32589 #[doc = "ID: 388"]
32590 CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA),
32591 #[doc = "A forwarded CAN frame as requested by MAV_CMD_CAN_FORWARD."]
32592 #[doc = ""]
32593 #[doc = "ID: 386"]
32594 CAN_FRAME(CAN_FRAME_DATA),
32595 #[doc = "Configure cellular modems. This message is re-emitted as an acknowledgement by the modem. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
32596 #[doc = ""]
32597 #[doc = "ID: 336"]
32598 CELLULAR_CONFIG(CELLULAR_CONFIG_DATA),
32599 #[doc = "Report current used cellular network status."]
32600 #[doc = ""]
32601 #[doc = "ID: 334"]
32602 CELLULAR_STATUS(CELLULAR_STATUS_DATA),
32603 #[doc = "Request to control this MAV."]
32604 #[doc = ""]
32605 #[doc = "ID: 5"]
32606 CHANGE_OPERATOR_CONTROL(CHANGE_OPERATOR_CONTROL_DATA),
32607 #[doc = "Accept / deny control of this MAV."]
32608 #[doc = ""]
32609 #[doc = "ID: 6"]
32610 CHANGE_OPERATOR_CONTROL_ACK(CHANGE_OPERATOR_CONTROL_ACK_DATA),
32611 #[doc = "Information about a potential collision."]
32612 #[doc = ""]
32613 #[doc = "ID: 247"]
32614 COLLISION(COLLISION_DATA),
32615 #[doc = "Report status of a command. Includes feedback whether the command was executed. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
32616 #[doc = ""]
32617 #[doc = "ID: 77"]
32618 COMMAND_ACK(COMMAND_ACK_DATA),
32619 #[doc = "Cancel a long running command. The target system should respond with a COMMAND_ACK to the original command with result=MAV_RESULT_CANCELLED if the long running process was cancelled. If it has already completed, the cancel action can be ignored. The cancel action can be retried until some sort of acknowledgement to the original command has been received. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
32620 #[doc = ""]
32621 #[doc = "ID: 80"]
32622 COMMAND_CANCEL(COMMAND_CANCEL_DATA),
32623 #[doc = "Send a command with up to seven parameters to the MAV, where params 5 and 6 are integers and the other values are floats. This is preferred over COMMAND_LONG as it allows the MAV_FRAME to be specified for interpreting positional information, such as altitude. COMMAND_INT is also preferred when sending latitude and longitude data in params 5 and 6, as it allows for greater precision. Param 5 and 6 encode positional data as scaled integers, where the scaling depends on the actual command value. NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
32624 #[doc = ""]
32625 #[doc = "ID: 75"]
32626 COMMAND_INT(COMMAND_INT_DATA),
32627 #[doc = "Send a command with up to seven parameters to the MAV. COMMAND_INT is generally preferred when sending MAV_CMD commands that include positional information; it offers higher precision and allows the MAV_FRAME to be specified (which may otherwise be ambiguous, particularly for altitude). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
32628 #[doc = ""]
32629 #[doc = "ID: 76"]
32630 COMMAND_LONG(COMMAND_LONG_DATA),
32631 #[doc = "Component information message, which may be requested using MAV_CMD_REQUEST_MESSAGE."]
32632 #[doc = ""]
32633 #[doc = "ID: 395"]
32634 #[deprecated = " See `COMPONENT_METADATA` (Deprecated since 2022-04)"]
32635 COMPONENT_INFORMATION(COMPONENT_INFORMATION_DATA),
32636 #[doc = "Basic component information data. Should be requested using MAV_CMD_REQUEST_MESSAGE on startup, or when required."]
32637 #[doc = ""]
32638 #[doc = "ID: 396"]
32639 COMPONENT_INFORMATION_BASIC(COMPONENT_INFORMATION_BASIC_DATA),
32640 #[doc = "Component metadata message, which may be requested using MAV_CMD_REQUEST_MESSAGE. This contains the MAVLink FTP URI and CRC for the component's general metadata file. The file must be hosted on the component, and may be xz compressed. The file CRC can be used for file caching. The general metadata file can be read to get the locations of other metadata files (COMP_METADATA_TYPE) and translations, which may be hosted either on the vehicle or the internet. For more information see: <https://mavlink.io/en/services/component_information.html>. Note: Camera components should use CAMERA_INFORMATION instead, and autopilots may use both this message and AUTOPILOT_VERSION."]
32641 #[doc = ""]
32642 #[doc = "ID: 397"]
32643 COMPONENT_METADATA(COMPONENT_METADATA_DATA),
32644 #[doc = "The smoothed, monotonic system state used to feed the control loops of the system."]
32645 #[doc = ""]
32646 #[doc = "ID: 146"]
32647 CONTROL_SYSTEM_STATE(CONTROL_SYSTEM_STATE_DATA),
32648 #[doc = "Regular broadcast for the current latest event sequence number for a component. This is used to check for dropped events."]
32649 #[doc = ""]
32650 #[doc = "ID: 411"]
32651 CURRENT_EVENT_SEQUENCE(CURRENT_EVENT_SEQUENCE_DATA),
32652 #[doc = "Get the current mode. This should be emitted on any mode change, and broadcast at low rate (nominally 0.5 Hz). It may be requested using MAV_CMD_REQUEST_MESSAGE. See <https://mavlink.io/en/services/standard_modes.html>."]
32653 #[doc = ""]
32654 #[doc = "ID: 436"]
32655 CURRENT_MODE(CURRENT_MODE_DATA),
32656 #[doc = "Data stream status information."]
32657 #[doc = ""]
32658 #[doc = "ID: 67"]
32659 #[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-08)"]
32660 DATA_STREAM(DATA_STREAM_DATA),
32661 #[doc = "Handshake message to initiate, control and stop image streaming when using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
32662 #[doc = ""]
32663 #[doc = "ID: 130"]
32664 DATA_TRANSMISSION_HANDSHAKE(DATA_TRANSMISSION_HANDSHAKE_DATA),
32665 #[doc = "Send a debug value. The index is used to discriminate between values. These values show up in the plot of QGroundControl as DEBUG N."]
32666 #[doc = ""]
32667 #[doc = "ID: 254"]
32668 DEBUG(DEBUG_DATA),
32669 #[doc = "Large debug/prototyping array. The message uses the maximum available payload for data. The array_id and name fields are used to discriminate between messages in code and in user interfaces (respectively). Do not use in production code."]
32670 #[doc = ""]
32671 #[doc = "ID: 350"]
32672 DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA),
32673 #[doc = "To debug something using a named 3D vector."]
32674 #[doc = ""]
32675 #[doc = "ID: 250"]
32676 DEBUG_VECT(DEBUG_VECT_DATA),
32677 #[doc = "Distance sensor information for an onboard rangefinder."]
32678 #[doc = ""]
32679 #[doc = "ID: 132"]
32680 DISTANCE_SENSOR(DISTANCE_SENSOR_DATA),
32681 #[doc = "EFI status output."]
32682 #[doc = ""]
32683 #[doc = "ID: 225"]
32684 EFI_STATUS(EFI_STATUS_DATA),
32685 #[doc = "Data packet for images sent using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
32686 #[doc = ""]
32687 #[doc = "ID: 131"]
32688 ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA),
32689 #[doc = "ESC information for lower rate streaming. Recommended streaming rate 1Hz. See ESC_STATUS for higher-rate ESC data."]
32690 #[doc = ""]
32691 #[doc = "ID: 290"]
32692 ESC_INFO(ESC_INFO_DATA),
32693 #[doc = "ESC information for higher rate streaming. Recommended streaming rate is ~10 Hz. Information that changes more slowly is sent in ESC_INFO. It should typically only be streamed on high-bandwidth links (i.e. to a companion computer)."]
32694 #[doc = ""]
32695 #[doc = "ID: 291"]
32696 ESC_STATUS(ESC_STATUS_DATA),
32697 #[doc = "Estimator status message including flags, innovation test ratios and estimated accuracies. The flags message is an integer bitmask containing information on which EKF outputs are valid. See the ESTIMATOR_STATUS_FLAGS enum definition for further information. The innovation test ratios show the magnitude of the sensor innovation divided by the innovation check threshold. Under normal operation the innovation test ratios should be below 0.5 with occasional values up to 1.0. Values greater than 1.0 should be rare under normal operation and indicate that a measurement has been rejected by the filter. The user should be notified if an innovation test ratio greater than 1.0 is recorded. Notifications for values in the range between 0.5 and 1.0 should be optional and controllable by the user."]
32698 #[doc = ""]
32699 #[doc = "ID: 230"]
32700 ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA),
32701 #[doc = "Event message. Each new event from a particular component gets a new sequence number. The same message might be sent multiple times if (re-)requested. Most events are broadcast, some can be specific to a target component (as receivers keep track of the sequence for missed events, all events need to be broadcast. Thus we use destination_component instead of target_component)."]
32702 #[doc = ""]
32703 #[doc = "ID: 410"]
32704 EVENT(EVENT_DATA),
32705 #[doc = "Provides state for additional features."]
32706 #[doc = ""]
32707 #[doc = "ID: 245"]
32708 EXTENDED_SYS_STATE(EXTENDED_SYS_STATE_DATA),
32709 #[doc = "Status of geo-fencing. Sent in extended status stream when fencing enabled."]
32710 #[doc = ""]
32711 #[doc = "ID: 162"]
32712 FENCE_STATUS(FENCE_STATUS_DATA),
32713 #[doc = "File transfer protocol message: <https://mavlink.io/en/services/ftp.html>."]
32714 #[doc = ""]
32715 #[doc = "ID: 110"]
32716 FILE_TRANSFER_PROTOCOL(FILE_TRANSFER_PROTOCOL_DATA),
32717 #[doc = "Flight information. This includes time since boot for arm, takeoff, and land, and a flight number. Takeoff and landing values reset to zero on arm. This can be requested using MAV_CMD_REQUEST_MESSAGE. Note, some fields are misnamed - timestamps are from boot (not UTC) and the flight_uuid is a sequence number."]
32718 #[doc = ""]
32719 #[doc = "ID: 264"]
32720 FLIGHT_INFORMATION(FLIGHT_INFORMATION_DATA),
32721 #[doc = "Current motion information from a designated system."]
32722 #[doc = ""]
32723 #[doc = "ID: 144"]
32724 FOLLOW_TARGET(FOLLOW_TARGET_DATA),
32725 #[doc = "Fuel status. This message provides \"generic\" fuel level information for in a GCS and for triggering failsafes in an autopilot. The fuel type and associated units for fields in this message are defined in the enum MAV_FUEL_TYPE. The reported `consumed_fuel` and `remaining_fuel` must only be supplied if measured: they must not be inferred from the `maximum_fuel` and the other value. A recipient can assume that if these fields are supplied they are accurate. If not provided, the recipient can infer `remaining_fuel` from `maximum_fuel` and `consumed_fuel` on the assumption that the fuel was initially at its maximum (this is what battery monitors assume). Note however that this is an assumption, and the UI should prompt the user appropriately (i.e. notify user that they should fill the tank before boot). This kind of information may also be sent in fuel-specific messages such as BATTERY_STATUS_V2. If both messages are sent for the same fuel system, the ids and corresponding information must match. This should be streamed (nominally at 0.1 Hz)."]
32726 #[doc = ""]
32727 #[doc = "ID: 371"]
32728 FUEL_STATUS(FUEL_STATUS_DATA),
32729 #[doc = "Telemetry of power generation system. Alternator or mechanical generator."]
32730 #[doc = ""]
32731 #[doc = "ID: 373"]
32732 GENERATOR_STATUS(GENERATOR_STATUS_DATA),
32733 #[doc = "Message reporting the status of a gimbal device. \t This message should be broadcast by a gimbal device component at a low regular rate (e.g. 5 Hz). \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Other conditions of the flags are not allowed. \t The quaternion and angular velocities in the other frame can be calculated from delta_yaw and delta_yaw_velocity as \t q_earth = q_delta_yaw * q_vehicle and w_earth = w_delta_yaw_velocity + w_vehicle (if not NaN). \t If neither the GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME nor the GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME flag is set, \t then (for backwards compatibility) the data in the delta_yaw and delta_yaw_velocity fields are to be ignored. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME, \t and always should set delta_yaw and delta_yaw_velocity either to the proper value or NaN."]
32734 #[doc = ""]
32735 #[doc = "ID: 285"]
32736 GIMBAL_DEVICE_ATTITUDE_STATUS(GIMBAL_DEVICE_ATTITUDE_STATUS_DATA),
32737 #[doc = "Information about a low level gimbal. This message should be requested by the gimbal manager or a ground station using MAV_CMD_REQUEST_MESSAGE. The maximum angles and rates are the limits by hardware. However, the limits by software used are likely different/smaller and dependent on mode/settings/etc.."]
32738 #[doc = ""]
32739 #[doc = "ID: 283"]
32740 GIMBAL_DEVICE_INFORMATION(GIMBAL_DEVICE_INFORMATION_DATA),
32741 #[doc = "Low level message to control a gimbal device's attitude. \t This message is to be sent from the gimbal manager to the gimbal device component. \t The quaternion and angular velocities can be set to NaN according to use case. \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Setting both GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME and GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is not allowed. \t These rules are to ensure backwards compatibility. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."]
32742 #[doc = ""]
32743 #[doc = "ID: 284"]
32744 GIMBAL_DEVICE_SET_ATTITUDE(GIMBAL_DEVICE_SET_ATTITUDE_DATA),
32745 #[doc = "Information about a high level gimbal manager. This message should be requested by a ground station using MAV_CMD_REQUEST_MESSAGE."]
32746 #[doc = ""]
32747 #[doc = "ID: 280"]
32748 GIMBAL_MANAGER_INFORMATION(GIMBAL_MANAGER_INFORMATION_DATA),
32749 #[doc = "High level message to control a gimbal's attitude. This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
32750 #[doc = ""]
32751 #[doc = "ID: 282"]
32752 GIMBAL_MANAGER_SET_ATTITUDE(GIMBAL_MANAGER_SET_ATTITUDE_DATA),
32753 #[doc = "High level message to control a gimbal manually. The angles or angular rates are unitless; the actual rates will depend on internal gimbal manager settings/configuration (e.g. set by parameters). This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
32754 #[doc = ""]
32755 #[doc = "ID: 288"]
32756 GIMBAL_MANAGER_SET_MANUAL_CONTROL(GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA),
32757 #[doc = "Set gimbal manager pitch and yaw angles (high rate message). This message is to be sent to the gimbal manager (e.g. from a ground station) and will be ignored by gimbal devices. Angles and rates can be set to NaN according to use case. Use MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW for low-rate adjustments that require confirmation."]
32758 #[doc = ""]
32759 #[doc = "ID: 287"]
32760 GIMBAL_MANAGER_SET_PITCHYAW(GIMBAL_MANAGER_SET_PITCHYAW_DATA),
32761 #[doc = "Current status about a high level gimbal manager. This message should be broadcast at a low regular rate (e.g. 5Hz)."]
32762 #[doc = ""]
32763 #[doc = "ID: 281"]
32764 GIMBAL_MANAGER_STATUS(GIMBAL_MANAGER_STATUS_DATA),
32765 #[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient."]
32766 #[doc = ""]
32767 #[doc = "ID: 33"]
32768 GLOBAL_POSITION_INT(GLOBAL_POSITION_INT_DATA),
32769 #[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient. NOTE: This message is intended for onboard networks / companion computers and higher-bandwidth links and optimized for accuracy and completeness. Please use the GLOBAL_POSITION_INT message for a minimal subset."]
32770 #[doc = ""]
32771 #[doc = "ID: 63"]
32772 GLOBAL_POSITION_INT_COV(GLOBAL_POSITION_INT_COV_DATA),
32773 #[doc = "Global position/attitude estimate from a vision source."]
32774 #[doc = ""]
32775 #[doc = "ID: 101"]
32776 GLOBAL_VISION_POSITION_ESTIMATE(GLOBAL_VISION_POSITION_ESTIMATE_DATA),
32777 #[doc = "Second GPS data."]
32778 #[doc = ""]
32779 #[doc = "ID: 124"]
32780 GPS2_RAW(GPS2_RAW_DATA),
32781 #[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
32782 #[doc = ""]
32783 #[doc = "ID: 128"]
32784 GPS2_RTK(GPS2_RTK_DATA),
32785 #[doc = "Publishes the GPS coordinates of the vehicle local origin (0,0,0) position. Emitted whenever a new GPS-Local position mapping is requested or set - e.g. following SET_GPS_GLOBAL_ORIGIN message."]
32786 #[doc = ""]
32787 #[doc = "ID: 49"]
32788 GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA),
32789 #[doc = "Data for injecting into the onboard GPS (used for DGPS)."]
32790 #[doc = ""]
32791 #[doc = "ID: 123"]
32792 #[deprecated = " See `GPS_RTCM_DATA` (Deprecated since 2022-05)"]
32793 GPS_INJECT_DATA(GPS_INJECT_DATA_DATA),
32794 #[doc = "GPS sensor input message. This is a raw sensor value sent by the GPS. This is NOT the global position estimate of the system."]
32795 #[doc = ""]
32796 #[doc = "ID: 232"]
32797 GPS_INPUT(GPS_INPUT_DATA),
32798 #[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
32799 #[doc = ""]
32800 #[doc = "ID: 24"]
32801 GPS_RAW_INT(GPS_RAW_INT_DATA),
32802 #[doc = "RTCM message for injecting into the onboard GPS (used for DGPS)."]
32803 #[doc = ""]
32804 #[doc = "ID: 233"]
32805 GPS_RTCM_DATA(GPS_RTCM_DATA_DATA),
32806 #[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
32807 #[doc = ""]
32808 #[doc = "ID: 127"]
32809 GPS_RTK(GPS_RTK_DATA),
32810 #[doc = "The positioning status, as reported by GPS. This message is intended to display status information about each satellite visible to the receiver. See message GLOBAL_POSITION_INT for the global position estimate. This message can contain information for up to 20 satellites."]
32811 #[doc = ""]
32812 #[doc = "ID: 25"]
32813 GPS_STATUS(GPS_STATUS_DATA),
32814 #[doc = "The heartbeat message shows that a system or component is present and responding. The type and autopilot fields (along with the message component id), allow the receiving system to treat further messages from this system appropriately (e.g. by laying out the user interface based on the autopilot). This microservice is documented at <https://mavlink.io/en/services/heartbeat.html>."]
32815 #[doc = ""]
32816 #[doc = "ID: 0"]
32817 HEARTBEAT(HEARTBEAT_DATA),
32818 #[doc = "The IMU readings in SI units in NED body frame."]
32819 #[doc = ""]
32820 #[doc = "ID: 105"]
32821 HIGHRES_IMU(HIGHRES_IMU_DATA),
32822 #[doc = "Message appropriate for high latency connections like Iridium."]
32823 #[doc = ""]
32824 #[doc = "ID: 234"]
32825 #[deprecated = " See `HIGH_LATENCY2` (Deprecated since 2020-10)"]
32826 HIGH_LATENCY(HIGH_LATENCY_DATA),
32827 #[doc = "Message appropriate for high latency connections like Iridium (version 2)."]
32828 #[doc = ""]
32829 #[doc = "ID: 235"]
32830 HIGH_LATENCY2(HIGH_LATENCY2_DATA),
32831 #[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_CONTROLS."]
32832 #[doc = ""]
32833 #[doc = "ID: 93"]
32834 HIL_ACTUATOR_CONTROLS(HIL_ACTUATOR_CONTROLS_DATA),
32835 #[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_ACTUATOR_CONTROLS."]
32836 #[doc = ""]
32837 #[doc = "ID: 91"]
32838 HIL_CONTROLS(HIL_CONTROLS_DATA),
32839 #[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
32840 #[doc = ""]
32841 #[doc = "ID: 113"]
32842 HIL_GPS(HIL_GPS_DATA),
32843 #[doc = "Simulated optical flow from a flow sensor (e.g. PX4FLOW or optical mouse sensor)."]
32844 #[doc = ""]
32845 #[doc = "ID: 114"]
32846 HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA),
32847 #[doc = "Sent from simulation to autopilot. The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification."]
32848 #[doc = ""]
32849 #[doc = "ID: 92"]
32850 HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA),
32851 #[doc = "The IMU readings in SI units in NED body frame."]
32852 #[doc = ""]
32853 #[doc = "ID: 107"]
32854 HIL_SENSOR(HIL_SENSOR_DATA),
32855 #[doc = "Sent from simulation to autopilot. This packet is useful for high throughput applications such as hardware in the loop simulations."]
32856 #[doc = ""]
32857 #[doc = "ID: 90"]
32858 #[deprecated = "Suffers from missing airspeed fields and singularities due to Euler angles. See `HIL_STATE_QUATERNION` (Deprecated since 2013-07)"]
32859 HIL_STATE(HIL_STATE_DATA),
32860 #[doc = "Sent from simulation to autopilot, avoids in contrast to HIL_STATE singularities. This packet is useful for high throughput applications such as hardware in the loop simulations."]
32861 #[doc = ""]
32862 #[doc = "ID: 115"]
32863 HIL_STATE_QUATERNION(HIL_STATE_QUATERNION_DATA),
32864 #[doc = "Contains the home position. \tThe home position is the default position that the system will return to and land on. \tThe position must be set automatically by the system during the takeoff, and may also be explicitly set using MAV_CMD_DO_SET_HOME. \tThe global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. \tUnder normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. \tThe approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: this message can be requested by sending the MAV_CMD_REQUEST_MESSAGE with param1=242 (or the deprecated MAV_CMD_GET_HOME_POSITION command)."]
32865 #[doc = ""]
32866 #[doc = "ID: 242"]
32867 HOME_POSITION(HOME_POSITION_DATA),
32868 #[doc = "Temperature and humidity from hygrometer."]
32869 #[doc = ""]
32870 #[doc = "ID: 12920"]
32871 HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA),
32872 #[doc = "Illuminator status."]
32873 #[doc = ""]
32874 #[doc = "ID: 440"]
32875 ILLUMINATOR_STATUS(ILLUMINATOR_STATUS_DATA),
32876 #[doc = "Status of the Iridium SBD link."]
32877 #[doc = ""]
32878 #[doc = "ID: 335"]
32879 ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA),
32880 #[doc = "The location of a landing target. See: <https://mavlink.io/en/services/landing_target.html>."]
32881 #[doc = ""]
32882 #[doc = "ID: 149"]
32883 LANDING_TARGET(LANDING_TARGET_DATA),
32884 #[doc = "Status generated in each node in the communication chain and injected into MAVLink stream."]
32885 #[doc = ""]
32886 #[doc = "ID: 8"]
32887 LINK_NODE_STATUS(LINK_NODE_STATUS_DATA),
32888 #[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
32889 #[doc = ""]
32890 #[doc = "ID: 32"]
32891 LOCAL_POSITION_NED(LOCAL_POSITION_NED_DATA),
32892 #[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
32893 #[doc = ""]
32894 #[doc = "ID: 64"]
32895 LOCAL_POSITION_NED_COV(LOCAL_POSITION_NED_COV_DATA),
32896 #[doc = "The offset in X, Y, Z and yaw between the LOCAL_POSITION_NED messages of MAV X and the global coordinate frame in NED coordinates. Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
32897 #[doc = ""]
32898 #[doc = "ID: 89"]
32899 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA),
32900 #[doc = "An ack for a LOGGING_DATA_ACKED message."]
32901 #[doc = ""]
32902 #[doc = "ID: 268"]
32903 LOGGING_ACK(LOGGING_ACK_DATA),
32904 #[doc = "A message containing logged data (see also MAV_CMD_LOGGING_START)."]
32905 #[doc = ""]
32906 #[doc = "ID: 266"]
32907 LOGGING_DATA(LOGGING_DATA_DATA),
32908 #[doc = "A message containing logged data which requires a LOGGING_ACK to be sent back."]
32909 #[doc = ""]
32910 #[doc = "ID: 267"]
32911 LOGGING_DATA_ACKED(LOGGING_DATA_ACKED_DATA),
32912 #[doc = "Reply to LOG_REQUEST_DATA."]
32913 #[doc = ""]
32914 #[doc = "ID: 120"]
32915 LOG_DATA(LOG_DATA_DATA),
32916 #[doc = "Reply to LOG_REQUEST_LIST."]
32917 #[doc = ""]
32918 #[doc = "ID: 118"]
32919 LOG_ENTRY(LOG_ENTRY_DATA),
32920 #[doc = "Erase all logs."]
32921 #[doc = ""]
32922 #[doc = "ID: 121"]
32923 LOG_ERASE(LOG_ERASE_DATA),
32924 #[doc = "Request a chunk of a log."]
32925 #[doc = ""]
32926 #[doc = "ID: 119"]
32927 LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA),
32928 #[doc = "Stop log transfer and resume normal logging."]
32929 #[doc = ""]
32930 #[doc = "ID: 122"]
32931 LOG_REQUEST_END(LOG_REQUEST_END_DATA),
32932 #[doc = "Request a list of available logs. On some systems calling this may stop on-board logging until LOG_REQUEST_END is called. If there are no log files available this request shall be answered with one LOG_ENTRY message with id = 0 and num_logs = 0."]
32933 #[doc = ""]
32934 #[doc = "ID: 117"]
32935 LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA),
32936 #[doc = "Reports results of completed compass calibration. Sent until MAG_CAL_ACK received."]
32937 #[doc = ""]
32938 #[doc = "ID: 192"]
32939 MAG_CAL_REPORT(MAG_CAL_REPORT_DATA),
32940 #[doc = "This message provides an API for manually controlling the vehicle using standard joystick axes nomenclature, along with a joystick-like input device. Unused axes can be disabled and buttons states are transmitted as individual on/off bits of a bitmask."]
32941 #[doc = ""]
32942 #[doc = "ID: 69"]
32943 MANUAL_CONTROL(MANUAL_CONTROL_DATA),
32944 #[doc = "Setpoint in roll, pitch, yaw and thrust from the operator."]
32945 #[doc = ""]
32946 #[doc = "ID: 81"]
32947 MANUAL_SETPOINT(MANUAL_SETPOINT_DATA),
32948 #[doc = "Send raw controller memory. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
32949 #[doc = ""]
32950 #[doc = "ID: 249"]
32951 MEMORY_VECT(MEMORY_VECT_DATA),
32952 #[doc = "The interval between messages for a particular MAVLink message ID. This message is sent in response to the MAV_CMD_REQUEST_MESSAGE command with param1=244 (this message) and param2=message_id (the id of the message for which the interval is required). \tIt may also be sent in response to MAV_CMD_GET_MESSAGE_INTERVAL. \tThis interface replaces DATA_STREAM."]
32953 #[doc = ""]
32954 #[doc = "ID: 244"]
32955 MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA),
32956 #[doc = "Acknowledgment message during waypoint handling. The type field states if this message is a positive ack (type=0) or if an error happened (type=non-zero)."]
32957 #[doc = ""]
32958 #[doc = "ID: 47"]
32959 MISSION_ACK(MISSION_ACK_DATA),
32960 #[doc = "Delete all mission items at once."]
32961 #[doc = ""]
32962 #[doc = "ID: 45"]
32963 MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA),
32964 #[doc = "This message is emitted as response to MISSION_REQUEST_LIST by the MAV and to initiate a write transaction. The GCS can then request the individual mission item based on the knowledge of the total number of waypoints."]
32965 #[doc = ""]
32966 #[doc = "ID: 44"]
32967 MISSION_COUNT(MISSION_COUNT_DATA),
32968 #[doc = "Message that announces the sequence number of the current target mission item (that the system will fly towards/execute when the mission is running). This message should be streamed all the time (nominally at 1Hz). This message should be emitted following a call to MAV_CMD_DO_SET_MISSION_CURRENT or MISSION_SET_CURRENT."]
32969 #[doc = ""]
32970 #[doc = "ID: 42"]
32971 MISSION_CURRENT(MISSION_CURRENT_DATA),
32972 #[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN may be used to indicate an optional/default value (e.g. to use the system's current latitude or yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
32973 #[doc = ""]
32974 #[doc = "ID: 39"]
32975 #[deprecated = " See `MISSION_ITEM_INT` (Deprecated since 2020-06)"]
32976 MISSION_ITEM(MISSION_ITEM_DATA),
32977 #[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
32978 #[doc = ""]
32979 #[doc = "ID: 73"]
32980 MISSION_ITEM_INT(MISSION_ITEM_INT_DATA),
32981 #[doc = "A certain mission item has been reached. The system will either hold this position (or circle on the orbit) or (if the autocontinue on the WP was set) continue to the next waypoint."]
32982 #[doc = ""]
32983 #[doc = "ID: 46"]
32984 MISSION_ITEM_REACHED(MISSION_ITEM_REACHED_DATA),
32985 #[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM message. <https://mavlink.io/en/services/mission.html>."]
32986 #[doc = ""]
32987 #[doc = "ID: 40"]
32988 #[deprecated = "A system that gets this request should respond with MISSION_ITEM_INT (as though MISSION_REQUEST_INT was received). See `MISSION_REQUEST_INT` (Deprecated since 2020-06)"]
32989 MISSION_REQUEST(MISSION_REQUEST_DATA),
32990 #[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM_INT message. <https://mavlink.io/en/services/mission.html>."]
32991 #[doc = ""]
32992 #[doc = "ID: 51"]
32993 MISSION_REQUEST_INT(MISSION_REQUEST_INT_DATA),
32994 #[doc = "Request the overall list of mission items from the system/component."]
32995 #[doc = ""]
32996 #[doc = "ID: 43"]
32997 MISSION_REQUEST_LIST(MISSION_REQUEST_LIST_DATA),
32998 #[doc = "Request a partial list of mission items from the system/component. <https://mavlink.io/en/services/mission.html>. If start and end index are the same, just send one waypoint."]
32999 #[doc = ""]
33000 #[doc = "ID: 37"]
33001 MISSION_REQUEST_PARTIAL_LIST(MISSION_REQUEST_PARTIAL_LIST_DATA),
33002 #[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. Note that mission jump repeat counters are not reset (see MAV_CMD_DO_JUMP param2). This message may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this message must not trigger a switch to mission mode."]
33003 #[doc = ""]
33004 #[doc = "ID: 41"]
33005 #[deprecated = " See `MAV_CMD_DO_SET_MISSION_CURRENT` (Deprecated since 2022-08)"]
33006 MISSION_SET_CURRENT(MISSION_SET_CURRENT_DATA),
33007 #[doc = "This message is sent to the MAV to write a partial list. If start index == end index, only one item will be transmitted / updated. If the start index is NOT 0 and above the current list size, this request should be REJECTED!."]
33008 #[doc = ""]
33009 #[doc = "ID: 38"]
33010 MISSION_WRITE_PARTIAL_LIST(MISSION_WRITE_PARTIAL_LIST_DATA),
33011 #[doc = "Orientation of a mount."]
33012 #[doc = ""]
33013 #[doc = "ID: 265"]
33014 #[deprecated = "This message is being superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
33015 MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA),
33016 #[doc = "Send a key-value pair as float. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
33017 #[doc = ""]
33018 #[doc = "ID: 251"]
33019 NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA),
33020 #[doc = "Send a key-value pair as integer. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
33021 #[doc = ""]
33022 #[doc = "ID: 252"]
33023 NAMED_VALUE_INT(NAMED_VALUE_INT_DATA),
33024 #[doc = "The state of the navigation and position controller."]
33025 #[doc = ""]
33026 #[doc = "ID: 62"]
33027 NAV_CONTROLLER_OUTPUT(NAV_CONTROLLER_OUTPUT_DATA),
33028 #[doc = "Accelerometer and Gyro biases from the navigation filter."]
33029 #[doc = ""]
33030 #[doc = "ID: 220"]
33031 NAV_FILTER_BIAS(NAV_FILTER_BIAS_DATA),
33032 #[doc = "Obstacle distances in front of the sensor, starting from the left in increment degrees to the right."]
33033 #[doc = ""]
33034 #[doc = "ID: 330"]
33035 OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA),
33036 #[doc = "Odometry message to communicate odometry information with an external interface. Fits ROS REP 147 standard for aerial vehicles (<http://www.ros.org/reps/rep-0147.html>)."]
33037 #[doc = ""]
33038 #[doc = "ID: 331"]
33039 ODOMETRY(ODOMETRY_DATA),
33040 #[doc = "Hardware status sent by an onboard computer."]
33041 #[doc = ""]
33042 #[doc = "ID: 390"]
33043 ONBOARD_COMPUTER_STATUS(ONBOARD_COMPUTER_STATUS_DATA),
33044 #[doc = "Transmitter (remote ID system) is enabled and ready to start sending location and other required information. This is streamed by transmitter. A flight controller uses it as a condition to arm."]
33045 #[doc = ""]
33046 #[doc = "ID: 12918"]
33047 OPEN_DRONE_ID_ARM_STATUS(OPEN_DRONE_ID_ARM_STATUS_DATA),
33048 #[doc = "Data for filling the OpenDroneID Authentication message. The Authentication Message defines a field that can provide a means of authenticity for the identity of the UAS (Unmanned Aircraft System). The Authentication message can have two different formats. For data page 0, the fields PageCount, Length and TimeStamp are present and AuthData is only 17 bytes. For data page 1 through 15, PageCount, Length and TimeStamp are not present and the size of AuthData is 23 bytes."]
33049 #[doc = ""]
33050 #[doc = "ID: 12902"]
33051 OPEN_DRONE_ID_AUTHENTICATION(OPEN_DRONE_ID_AUTHENTICATION_DATA),
33052 #[doc = "Data for filling the OpenDroneID Basic ID message. This and the below messages are primarily meant for feeding data to/from an OpenDroneID implementation. E.g. <https://github.com/opendroneid/opendroneid-core-c>. These messages are compatible with the ASTM F3411 Remote ID standard and the ASD-STAN prEN 4709-002 Direct Remote ID standard. Additional information and usage of these messages is documented at <https://mavlink.io/en/services/opendroneid.html>."]
33053 #[doc = ""]
33054 #[doc = "ID: 12900"]
33055 OPEN_DRONE_ID_BASIC_ID(OPEN_DRONE_ID_BASIC_ID_DATA),
33056 #[doc = "Data for filling the OpenDroneID Location message. The float data types are 32-bit IEEE 754. The Location message provides the location, altitude, direction and speed of the aircraft."]
33057 #[doc = ""]
33058 #[doc = "ID: 12901"]
33059 OPEN_DRONE_ID_LOCATION(OPEN_DRONE_ID_LOCATION_DATA),
33060 #[doc = "An OpenDroneID message pack is a container for multiple encoded OpenDroneID messages (i.e. not in the format given for the above message descriptions but after encoding into the compressed OpenDroneID byte format). Used e.g. when transmitting on Bluetooth 5.0 Long Range/Extended Advertising or on WiFi Neighbor Aware Networking or on WiFi Beacon."]
33061 #[doc = ""]
33062 #[doc = "ID: 12915"]
33063 OPEN_DRONE_ID_MESSAGE_PACK(OPEN_DRONE_ID_MESSAGE_PACK_DATA),
33064 #[doc = "Data for filling the OpenDroneID Operator ID message, which contains the CAA (Civil Aviation Authority) issued operator ID."]
33065 #[doc = ""]
33066 #[doc = "ID: 12905"]
33067 OPEN_DRONE_ID_OPERATOR_ID(OPEN_DRONE_ID_OPERATOR_ID_DATA),
33068 #[doc = "Data for filling the OpenDroneID Self ID message. The Self ID Message is an opportunity for the operator to (optionally) declare their identity and purpose of the flight. This message can provide additional information that could reduce the threat profile of a UA (Unmanned Aircraft) flying in a particular area or manner. This message can also be used to provide optional additional clarification in an emergency/remote ID system failure situation."]
33069 #[doc = ""]
33070 #[doc = "ID: 12903"]
33071 OPEN_DRONE_ID_SELF_ID(OPEN_DRONE_ID_SELF_ID_DATA),
33072 #[doc = "Data for filling the OpenDroneID System message. The System Message contains general system information including the operator location/altitude and possible aircraft group and/or category/class information."]
33073 #[doc = ""]
33074 #[doc = "ID: 12904"]
33075 OPEN_DRONE_ID_SYSTEM(OPEN_DRONE_ID_SYSTEM_DATA),
33076 #[doc = "Update the data in the OPEN_DRONE_ID_SYSTEM message with new location information. This can be sent to update the location information for the operator when no other information in the SYSTEM message has changed. This message allows for efficient operation on radio links which have limited uplink bandwidth while meeting requirements for update frequency of the operator location."]
33077 #[doc = ""]
33078 #[doc = "ID: 12919"]
33079 OPEN_DRONE_ID_SYSTEM_UPDATE(OPEN_DRONE_ID_SYSTEM_UPDATE_DATA),
33080 #[doc = "Optical flow from a flow sensor (e.g. optical mouse sensor)."]
33081 #[doc = ""]
33082 #[doc = "ID: 100"]
33083 OPTICAL_FLOW(OPTICAL_FLOW_DATA),
33084 #[doc = "Optical flow from an angular rate flow sensor (e.g. PX4FLOW or mouse sensor)."]
33085 #[doc = ""]
33086 #[doc = "ID: 106"]
33087 OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA),
33088 #[doc = "Vehicle status report that is sent out while orbit execution is in progress (see MAV_CMD_DO_ORBIT)."]
33089 #[doc = ""]
33090 #[doc = "ID: 360"]
33091 ORBIT_EXECUTION_STATUS(ORBIT_EXECUTION_STATUS_DATA),
33092 #[doc = "Response from a PARAM_EXT_SET message."]
33093 #[doc = ""]
33094 #[doc = "ID: 324"]
33095 PARAM_EXT_ACK(PARAM_EXT_ACK_DATA),
33096 #[doc = "Request all parameters of this component. All parameters should be emitted in response as PARAM_EXT_VALUE."]
33097 #[doc = ""]
33098 #[doc = "ID: 321"]
33099 PARAM_EXT_REQUEST_LIST(PARAM_EXT_REQUEST_LIST_DATA),
33100 #[doc = "Request to read the value of a parameter with either the param_id string id or param_index. PARAM_EXT_VALUE should be emitted in response."]
33101 #[doc = ""]
33102 #[doc = "ID: 320"]
33103 PARAM_EXT_REQUEST_READ(PARAM_EXT_REQUEST_READ_DATA),
33104 #[doc = "Set a parameter value. In order to deal with message loss (and retransmission of PARAM_EXT_SET), when setting a parameter value and the new value is the same as the current value, you will immediately get a PARAM_ACK_ACCEPTED response. If the current state is PARAM_ACK_IN_PROGRESS, you will accordingly receive a PARAM_ACK_IN_PROGRESS in response."]
33105 #[doc = ""]
33106 #[doc = "ID: 323"]
33107 PARAM_EXT_SET(PARAM_EXT_SET_DATA),
33108 #[doc = "Emit the value of a parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows them to re-request missing parameters after a loss or timeout."]
33109 #[doc = ""]
33110 #[doc = "ID: 322"]
33111 PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA),
33112 #[doc = "Bind a RC channel to a parameter. The parameter should change according to the RC channel value."]
33113 #[doc = ""]
33114 #[doc = "ID: 50"]
33115 PARAM_MAP_RC(PARAM_MAP_RC_DATA),
33116 #[doc = "Request all parameters of this component. After this request, all parameters are emitted. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
33117 #[doc = ""]
33118 #[doc = "ID: 21"]
33119 PARAM_REQUEST_LIST(PARAM_REQUEST_LIST_DATA),
33120 #[doc = "value[float]. This allows to send a parameter to any other component (such as the GCS) without the need of previous knowledge of possible parameter names. Thus the same GCS can store different parameters for different autopilots. See also <https://mavlink.io/en/services/parameter.html> for a full documentation of QGroundControl and IMU code."]
33121 #[doc = ""]
33122 #[doc = "ID: 20"]
33123 PARAM_REQUEST_READ(PARAM_REQUEST_READ_DATA),
33124 #[doc = "Set a parameter value (write new value to permanent storage). The receiving component should acknowledge the new parameter value by broadcasting a PARAM_VALUE message (broadcasting ensures that multiple GCS all have an up-to-date list of all parameters). If the sending GCS did not receive a PARAM_VALUE within its timeout time, it should re-send the PARAM_SET message. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
33125 #[doc = ""]
33126 #[doc = "ID: 23"]
33127 PARAM_SET(PARAM_SET_DATA),
33128 #[doc = "Emit the value of a onboard parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows him to re-request missing parameters after a loss or timeout. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
33129 #[doc = ""]
33130 #[doc = "ID: 22"]
33131 PARAM_VALUE(PARAM_VALUE_DATA),
33132 #[doc = "A ping message either requesting or responding to a ping. This allows to measure the system latencies, including serial port, radio modem and UDP connections. The ping microservice is documented at <https://mavlink.io/en/services/ping.html>."]
33133 #[doc = ""]
33134 #[doc = "ID: 4"]
33135 #[deprecated = "To be removed / merged with TIMESYNC. See `TIMESYNC` (Deprecated since 2011-08)"]
33136 PING(PING_DATA),
33137 #[doc = "Control vehicle tone generation (buzzer)."]
33138 #[doc = ""]
33139 #[doc = "ID: 258"]
33140 #[deprecated = "New version explicitly defines format. More interoperable. See `PLAY_TUNE_V2` (Deprecated since 2019-10)"]
33141 PLAY_TUNE(PLAY_TUNE_DATA),
33142 #[doc = "Play vehicle tone/tune (buzzer). Supersedes message PLAY_TUNE."]
33143 #[doc = ""]
33144 #[doc = "ID: 400"]
33145 PLAY_TUNE_V2(PLAY_TUNE_V2_DATA),
33146 #[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_GLOBAL_INT if the vehicle is being controlled this way."]
33147 #[doc = ""]
33148 #[doc = "ID: 87"]
33149 POSITION_TARGET_GLOBAL_INT(POSITION_TARGET_GLOBAL_INT_DATA),
33150 #[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_LOCAL_NED if the vehicle is being controlled this way."]
33151 #[doc = ""]
33152 #[doc = "ID: 85"]
33153 POSITION_TARGET_LOCAL_NED(POSITION_TARGET_LOCAL_NED_DATA),
33154 #[doc = "Power supply status."]
33155 #[doc = ""]
33156 #[doc = "ID: 125"]
33157 POWER_STATUS(POWER_STATUS_DATA),
33158 #[doc = "Version and capability of protocol version. This message can be requested with MAV_CMD_REQUEST_MESSAGE and is used as part of the handshaking to establish which MAVLink version should be used on the network. Every node should respond to a request for PROTOCOL_VERSION to enable the handshaking. Library implementers should consider adding this into the default decoding state machine to allow the protocol core to respond directly."]
33159 #[doc = ""]
33160 #[doc = "ID: 300"]
33161 PROTOCOL_VERSION(PROTOCOL_VERSION_DATA),
33162 #[doc = "Complete set of calibration parameters for the radio."]
33163 #[doc = ""]
33164 #[doc = "ID: 221"]
33165 RADIO_CALIBRATION(RADIO_CALIBRATION_DATA),
33166 #[doc = "Status generated by radio and injected into MAVLink stream."]
33167 #[doc = ""]
33168 #[doc = "ID: 109"]
33169 RADIO_STATUS(RADIO_STATUS_DATA),
33170 #[doc = "The RAW IMU readings for a 9DOF sensor, which is identified by the id (default IMU1). This message should always contain the true raw values without any scaling to allow data capture and system debugging."]
33171 #[doc = ""]
33172 #[doc = "ID: 27"]
33173 RAW_IMU(RAW_IMU_DATA),
33174 #[doc = "The RAW pressure readings for the typical setup of one absolute pressure and one differential pressure sensor. The sensor values should be the raw, UNSCALED ADC values."]
33175 #[doc = ""]
33176 #[doc = "ID: 28"]
33177 RAW_PRESSURE(RAW_PRESSURE_DATA),
33178 #[doc = "RPM sensor data message."]
33179 #[doc = ""]
33180 #[doc = "ID: 339"]
33181 RAW_RPM(RAW_RPM_DATA),
33182 #[doc = "The PPM values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
33183 #[doc = ""]
33184 #[doc = "ID: 65"]
33185 RC_CHANNELS(RC_CHANNELS_DATA),
33186 #[doc = "The RAW values of the RC channels sent to the MAV to override info received from the RC radio. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. Note carefully the semantic differences between the first 8 channels and the subsequent channels."]
33187 #[doc = ""]
33188 #[doc = "ID: 70"]
33189 RC_CHANNELS_OVERRIDE(RC_CHANNELS_OVERRIDE_DATA),
33190 #[doc = "The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
33191 #[doc = ""]
33192 #[doc = "ID: 35"]
33193 RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA),
33194 #[doc = "The scaled values of the RC channels received: (-100%) -10000, (0%) 0, (100%) 10000. Channels that are inactive should be set to INT16_MAX."]
33195 #[doc = ""]
33196 #[doc = "ID: 34"]
33197 RC_CHANNELS_SCALED(RC_CHANNELS_SCALED_DATA),
33198 #[doc = "Request a data stream."]
33199 #[doc = ""]
33200 #[doc = "ID: 66"]
33201 #[deprecated = " See `MAV_CMD_SET_MESSAGE_INTERVAL ` (Deprecated since 2015-08)"]
33202 REQUEST_DATA_STREAM(REQUEST_DATA_STREAM_DATA),
33203 #[doc = "Request one or more events to be (re-)sent. If first_sequence==last_sequence, only a single event is requested. Note that first_sequence can be larger than last_sequence (because the sequence number can wrap). Each sequence will trigger an EVENT or EVENT_ERROR response."]
33204 #[doc = ""]
33205 #[doc = "ID: 412"]
33206 REQUEST_EVENT(REQUEST_EVENT_DATA),
33207 #[doc = "The autopilot is requesting a resource (file, binary, other type of data)."]
33208 #[doc = ""]
33209 #[doc = "ID: 142"]
33210 RESOURCE_REQUEST(RESOURCE_REQUEST_DATA),
33211 #[doc = "Response to a REQUEST_EVENT in case of an error (e.g. the event is not available anymore)."]
33212 #[doc = ""]
33213 #[doc = "ID: 413"]
33214 RESPONSE_EVENT_ERROR(RESPONSE_EVENT_ERROR_DATA),
33215 #[doc = "Read out the safety zone the MAV currently assumes."]
33216 #[doc = ""]
33217 #[doc = "ID: 55"]
33218 SAFETY_ALLOWED_AREA(SAFETY_ALLOWED_AREA_DATA),
33219 #[doc = "Set a safety zone (volume), which is defined by two corners of a cube. This message can be used to tell the MAV which setpoints/waypoints to accept and which to reject. Safety areas are often enforced by national or competition regulations."]
33220 #[doc = ""]
33221 #[doc = "ID: 54"]
33222 SAFETY_SET_ALLOWED_AREA(SAFETY_SET_ALLOWED_AREA_DATA),
33223 #[doc = "The RAW IMU readings for the usual 9DOF sensor setup. This message should contain the scaled values to the described units."]
33224 #[doc = ""]
33225 #[doc = "ID: 26"]
33226 SCALED_IMU(SCALED_IMU_DATA),
33227 #[doc = "The RAW IMU readings for secondary 9DOF sensor setup. This message should contain the scaled values to the described units."]
33228 #[doc = ""]
33229 #[doc = "ID: 116"]
33230 SCALED_IMU2(SCALED_IMU2_DATA),
33231 #[doc = "The RAW IMU readings for 3rd 9DOF sensor setup. This message should contain the scaled values to the described units."]
33232 #[doc = ""]
33233 #[doc = "ID: 129"]
33234 SCALED_IMU3(SCALED_IMU3_DATA),
33235 #[doc = "The pressure readings for the typical setup of one absolute and differential pressure sensor. The units are as specified in each field."]
33236 #[doc = ""]
33237 #[doc = "ID: 29"]
33238 SCALED_PRESSURE(SCALED_PRESSURE_DATA),
33239 #[doc = "Barometer readings for 2nd barometer."]
33240 #[doc = ""]
33241 #[doc = "ID: 137"]
33242 SCALED_PRESSURE2(SCALED_PRESSURE2_DATA),
33243 #[doc = "Barometer readings for 3rd barometer."]
33244 #[doc = ""]
33245 #[doc = "ID: 143"]
33246 SCALED_PRESSURE3(SCALED_PRESSURE3_DATA),
33247 #[doc = "Control a serial port. This can be used for raw access to an onboard serial peripheral such as a GPS or telemetry radio. It is designed to make it possible to update the devices firmware via MAVLink messages or change the devices settings. A message with zero bytes can be used to change just the baudrate."]
33248 #[doc = ""]
33249 #[doc = "ID: 126"]
33250 SERIAL_CONTROL(SERIAL_CONTROL_DATA),
33251 #[doc = "Superseded by ACTUATOR_OUTPUT_STATUS. The RAW values of the servo outputs (for RC input from the remote, use the RC_CHANNELS messages). The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%."]
33252 #[doc = ""]
33253 #[doc = "ID: 36"]
33254 SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA),
33255 #[doc = "Setup a MAVLink2 signing key. If called with secret_key of all zero and zero initial_timestamp will disable signing."]
33256 #[doc = ""]
33257 #[doc = "ID: 256"]
33258 SETUP_SIGNING(SETUP_SIGNING_DATA),
33259 #[doc = "Set the vehicle attitude and body angular rates."]
33260 #[doc = ""]
33261 #[doc = "ID: 139"]
33262 SET_ACTUATOR_CONTROL_TARGET(SET_ACTUATOR_CONTROL_TARGET_DATA),
33263 #[doc = "Sets a desired vehicle attitude. Used by an external controller to command the vehicle (manual controller or other system)."]
33264 #[doc = ""]
33265 #[doc = "ID: 82"]
33266 SET_ATTITUDE_TARGET(SET_ATTITUDE_TARGET_DATA),
33267 #[doc = "Sets the GPS coordinates of the vehicle local origin (0,0,0) position. Vehicle should emit GPS_GLOBAL_ORIGIN irrespective of whether the origin is changed. This enables transform between the local coordinate frame and the global (GPS) coordinate frame, which may be necessary when (for example) indoor and outdoor settings are connected and the MAV should move from in- to outdoor."]
33268 #[doc = ""]
33269 #[doc = "ID: 48"]
33270 #[deprecated = " See `MAV_CMD_SET_GLOBAL_ORIGIN` (Deprecated since 2025-04)"]
33271 SET_GPS_GLOBAL_ORIGIN(SET_GPS_GLOBAL_ORIGIN_DATA),
33272 #[doc = "Sets the home position. \tThe home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this message). The global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. Under normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. The approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
33273 #[doc = ""]
33274 #[doc = "ID: 243"]
33275 #[deprecated = "The command protocol version (MAV_CMD_DO_SET_HOME) allows a GCS to detect when setting the home position has failed. See `MAV_CMD_DO_SET_HOME` (Deprecated since 2022-02)"]
33276 SET_HOME_POSITION(SET_HOME_POSITION_DATA),
33277 #[doc = "Set the system mode, as defined by enum MAV_MODE. There is no target component id as the mode is by definition for the overall aircraft, not only for one component."]
33278 #[doc = ""]
33279 #[doc = "ID: 11"]
33280 #[deprecated = "Use COMMAND_LONG with MAV_CMD_DO_SET_MODE instead. See `MAV_CMD_DO_SET_MODE` (Deprecated since 2015-12)"]
33281 SET_MODE(SET_MODE_DATA),
33282 #[doc = "Sets a desired vehicle position, velocity, and/or acceleration in a global coordinate system (WGS84). Used by an external controller to command the vehicle (manual controller or other system)."]
33283 #[doc = ""]
33284 #[doc = "ID: 86"]
33285 SET_POSITION_TARGET_GLOBAL_INT(SET_POSITION_TARGET_GLOBAL_INT_DATA),
33286 #[doc = "Sets a desired vehicle position in a local north-east-down coordinate frame. Used by an external controller to command the vehicle (manual controller or other system)."]
33287 #[doc = ""]
33288 #[doc = "ID: 84"]
33289 SET_POSITION_TARGET_LOCAL_NED(SET_POSITION_TARGET_LOCAL_NED_DATA),
33290 #[doc = "Status of simulation environment, if used."]
33291 #[doc = ""]
33292 #[doc = "ID: 108"]
33293 SIM_STATE(SIM_STATE_DATA),
33294 #[doc = "Smart Battery information (static/infrequent update). Use for updates from: smart battery to flight stack, flight stack to GCS. Use BATTERY_STATUS for the frequent battery updates."]
33295 #[doc = ""]
33296 #[doc = "ID: 370"]
33297 #[deprecated = "The BATTERY_INFO message is better aligned with UAVCAN messages, and in any case is useful even if a battery is not \"smart\". See `BATTERY_INFO` (Deprecated since 2024-02)"]
33298 SMART_BATTERY_INFO(SMART_BATTERY_INFO_DATA),
33299 #[doc = "Status text message. These messages are printed in yellow in the COMM console of QGroundControl. WARNING: They consume quite some bandwidth, so use only for important status and error messages. If implemented wisely, these messages are buffered on the MCU and sent only at a limited rate (e.g. 10 Hz)."]
33300 #[doc = ""]
33301 #[doc = "ID: 253"]
33302 STATUSTEXT(STATUSTEXT_DATA),
33303 #[doc = "Information about a storage medium. This message is sent in response to a request with MAV_CMD_REQUEST_MESSAGE and whenever the status of the storage changes (STORAGE_STATUS). Use MAV_CMD_REQUEST_MESSAGE.param2 to indicate the index/id of requested storage: 0 for all, 1 for first, 2 for second, etc."]
33304 #[doc = ""]
33305 #[doc = "ID: 261"]
33306 STORAGE_INFORMATION(STORAGE_INFORMATION_DATA),
33307 #[doc = "Tune formats supported by vehicle. This should be emitted as response to MAV_CMD_REQUEST_MESSAGE."]
33308 #[doc = ""]
33309 #[doc = "ID: 401"]
33310 SUPPORTED_TUNES(SUPPORTED_TUNES_DATA),
33311 #[doc = "The system time is the time of the master clock. This can be emitted by flight controllers, onboard computers, or other components in the MAVLink network. Components that are using a less reliable time source, such as a battery-backed real time clock, can choose to match their system clock to that of a SYSTEM_TYPE that indicates a more recent time. This allows more broadly accurate date stamping of logs, and so on. If precise time synchronization is needed then use TIMESYNC instead."]
33312 #[doc = ""]
33313 #[doc = "ID: 2"]
33314 SYSTEM_TIME(SYSTEM_TIME_DATA),
33315 #[doc = "The general system state. If the system is following the MAVLink standard, the system state is mainly defined by three orthogonal states/modes: The system mode, which is either LOCKED (motors shut down and locked), MANUAL (system under RC control), GUIDED (system with autonomous position control, position setpoint controlled manually) or AUTO (system guided by path/waypoint planner). The NAV_MODE defined the current flight state: LIFTOFF (often an open-loop maneuver), LANDING, WAYPOINTS or VECTOR. This represents the internal navigation state machine. The system status shows whether the system is currently active or not and if an emergency occurred. During the CRITICAL and EMERGENCY states the MAV is still considered to be active, but should start emergency procedures autonomously. After a failure occurred it should first move from active to critical to allow manual intervention and then move to emergency after a certain timeout."]
33316 #[doc = ""]
33317 #[doc = "ID: 1"]
33318 SYS_STATUS(SYS_STATUS_DATA),
33319 #[doc = "Request that the vehicle report terrain height at the given location (expected response is a TERRAIN_REPORT). Used by GCS to check if vehicle has all terrain data needed for a mission."]
33320 #[doc = ""]
33321 #[doc = "ID: 135"]
33322 TERRAIN_CHECK(TERRAIN_CHECK_DATA),
33323 #[doc = "Terrain data sent from GCS. The lat/lon and grid_spacing must be the same as a lat/lon from a TERRAIN_REQUEST. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
33324 #[doc = ""]
33325 #[doc = "ID: 134"]
33326 TERRAIN_DATA(TERRAIN_DATA_DATA),
33327 #[doc = "Streamed from drone to report progress of terrain map download (initiated by TERRAIN_REQUEST), or sent as a response to a TERRAIN_CHECK request. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
33328 #[doc = ""]
33329 #[doc = "ID: 136"]
33330 TERRAIN_REPORT(TERRAIN_REPORT_DATA),
33331 #[doc = "Request for terrain data and terrain status. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
33332 #[doc = ""]
33333 #[doc = "ID: 133"]
33334 TERRAIN_REQUEST(TERRAIN_REQUEST_DATA),
33335 #[doc = "Time synchronization message. The message is used for both timesync requests and responses. The request is sent with `ts1=syncing component timestamp` and `tc1=0`, and may be broadcast or targeted to a specific system/component. The response is sent with `ts1=syncing component timestamp` (mirror back unchanged), and `tc1=responding component timestamp`, with the `target_system` and `target_component` set to ids of the original request. Systems can determine if they are receiving a request or response based on the value of `tc`. If the response has `target_system==target_component==0` the remote system has not been updated to use the component IDs and cannot reliably timesync; the requestor may report an error. Timestamps are UNIX Epoch time or time since system boot in nanoseconds (the timestamp format can be inferred by checking for the magnitude of the number; generally it doesn't matter as only the offset is used). The message sequence is repeated numerous times with results being filtered/averaged to estimate the offset. See also: <https://mavlink.io/en/services/timesync.html>."]
33336 #[doc = ""]
33337 #[doc = "ID: 111"]
33338 TIMESYNC(TIMESYNC_DATA),
33339 #[doc = "Time/duration estimates for various events and actions given the current vehicle state and position."]
33340 #[doc = ""]
33341 #[doc = "ID: 380"]
33342 TIME_ESTIMATE_TO_TARGET(TIME_ESTIMATE_TO_TARGET_DATA),
33343 #[doc = "Describe a trajectory using an array of up-to 5 bezier control points in the local frame (MAV_FRAME_LOCAL_NED)."]
33344 #[doc = ""]
33345 #[doc = "ID: 333"]
33346 TRAJECTORY_REPRESENTATION_BEZIER(TRAJECTORY_REPRESENTATION_BEZIER_DATA),
33347 #[doc = "Describe a trajectory using an array of up-to 5 waypoints in the local frame (MAV_FRAME_LOCAL_NED)."]
33348 #[doc = ""]
33349 #[doc = "ID: 332"]
33350 TRAJECTORY_REPRESENTATION_WAYPOINTS(TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA),
33351 #[doc = "Message for transporting \"arbitrary\" variable-length data from one component to another (broadcast is not forbidden, but discouraged). The encoding of the data is usually extension specific, i.e. determined by the source, and is usually not documented as part of the MAVLink specification."]
33352 #[doc = ""]
33353 #[doc = "ID: 385"]
33354 TUNNEL(TUNNEL_DATA),
33355 #[doc = "System status specific to ualberta uav."]
33356 #[doc = ""]
33357 #[doc = "ID: 222"]
33358 UALBERTA_SYS_STATUS(UALBERTA_SYS_STATUS_DATA),
33359 #[doc = "General information describing a particular UAVCAN node. Please refer to the definition of the UAVCAN service \"uavcan.protocol.GetNodeInfo\" for the background information. This message should be emitted by the system whenever a new node appears online, or an existing node reboots. Additionally, it can be emitted upon request from the other end of the MAVLink channel (see MAV_CMD_UAVCAN_GET_NODE_INFO). It is also not prohibited to emit this message unconditionally at a low frequency. The UAVCAN specification is available at <http://uavcan.org>."]
33360 #[doc = ""]
33361 #[doc = "ID: 311"]
33362 UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA),
33363 #[doc = "General status information of an UAVCAN node. Please refer to the definition of the UAVCAN message \"uavcan.protocol.NodeStatus\" for the background information. The UAVCAN specification is available at <http://uavcan.org>."]
33364 #[doc = ""]
33365 #[doc = "ID: 310"]
33366 UAVCAN_NODE_STATUS(UAVCAN_NODE_STATUS_DATA),
33367 #[doc = "The global position resulting from GPS and sensor fusion."]
33368 #[doc = ""]
33369 #[doc = "ID: 340"]
33370 UTM_GLOBAL_POSITION(UTM_GLOBAL_POSITION_DATA),
33371 #[doc = "Message implementing parts of the V2 payload specs in V1 frames for transitional support."]
33372 #[doc = ""]
33373 #[doc = "ID: 248"]
33374 V2_EXTENSION(V2_EXTENSION_DATA),
33375 #[doc = "Metrics typically displayed on a HUD for fixed wing aircraft."]
33376 #[doc = ""]
33377 #[doc = "ID: 74"]
33378 VFR_HUD(VFR_HUD_DATA),
33379 #[doc = "Vibration levels and accelerometer clipping."]
33380 #[doc = ""]
33381 #[doc = "ID: 241"]
33382 VIBRATION(VIBRATION_DATA),
33383 #[doc = "Global position estimate from a Vicon motion system source."]
33384 #[doc = ""]
33385 #[doc = "ID: 104"]
33386 VICON_POSITION_ESTIMATE(VICON_POSITION_ESTIMATE_DATA),
33387 #[doc = "Information about video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE, where param2 indicates the video stream id: 0 for all streams, 1 for first, 2 for second, etc."]
33388 #[doc = ""]
33389 #[doc = "ID: 269"]
33390 VIDEO_STREAM_INFORMATION(VIDEO_STREAM_INFORMATION_DATA),
33391 #[doc = "Information about the status of a video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE."]
33392 #[doc = ""]
33393 #[doc = "ID: 270"]
33394 VIDEO_STREAM_STATUS(VIDEO_STREAM_STATUS_DATA),
33395 #[doc = "Local position/attitude estimate from a vision source."]
33396 #[doc = ""]
33397 #[doc = "ID: 102"]
33398 VISION_POSITION_ESTIMATE(VISION_POSITION_ESTIMATE_DATA),
33399 #[doc = "Speed estimate from a vision source."]
33400 #[doc = ""]
33401 #[doc = "ID: 103"]
33402 VISION_SPEED_ESTIMATE(VISION_SPEED_ESTIMATE_DATA),
33403 #[doc = "Cumulative distance traveled for each reported wheel."]
33404 #[doc = ""]
33405 #[doc = "ID: 9000"]
33406 WHEEL_DISTANCE(WHEEL_DISTANCE_DATA),
33407 #[doc = "Configure WiFi AP SSID, password, and mode. This message is re-emitted as an acknowledgement by the AP. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
33408 #[doc = ""]
33409 #[doc = "ID: 299"]
33410 WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA),
33411 #[doc = "Winch status."]
33412 #[doc = ""]
33413 #[doc = "ID: 9005"]
33414 WINCH_STATUS(WINCH_STATUS_DATA),
33415 #[doc = "Wind estimate from vehicle. Note that despite the name, this message does not actually contain any covariances but instead variability and accuracy fields in terms of standard deviation (1-STD)."]
33416 #[doc = ""]
33417 #[doc = "ID: 231"]
33418 WIND_COV(WIND_COV_DATA),
33419}
33420impl MavMessage {
33421 pub const fn all_ids() -> &'static [u32] {
33422 &[
33423 0u32, 1u32, 2u32, 4u32, 5u32, 6u32, 7u32, 8u32, 11u32, 20u32, 21u32, 22u32, 23u32,
33424 24u32, 25u32, 26u32, 27u32, 28u32, 29u32, 30u32, 31u32, 32u32, 33u32, 34u32, 35u32,
33425 36u32, 37u32, 38u32, 39u32, 40u32, 41u32, 42u32, 43u32, 44u32, 45u32, 46u32, 47u32,
33426 48u32, 49u32, 50u32, 51u32, 54u32, 55u32, 61u32, 62u32, 63u32, 64u32, 65u32, 66u32,
33427 67u32, 69u32, 70u32, 73u32, 74u32, 75u32, 76u32, 77u32, 80u32, 81u32, 82u32, 83u32,
33428 84u32, 85u32, 86u32, 87u32, 89u32, 90u32, 91u32, 92u32, 93u32, 100u32, 101u32, 102u32,
33429 103u32, 104u32, 105u32, 106u32, 107u32, 108u32, 109u32, 110u32, 111u32, 112u32, 113u32,
33430 114u32, 115u32, 116u32, 117u32, 118u32, 119u32, 120u32, 121u32, 122u32, 123u32, 124u32,
33431 125u32, 126u32, 127u32, 128u32, 129u32, 130u32, 131u32, 132u32, 133u32, 134u32, 135u32,
33432 136u32, 137u32, 138u32, 139u32, 140u32, 141u32, 142u32, 143u32, 144u32, 146u32, 147u32,
33433 148u32, 149u32, 162u32, 192u32, 220u32, 221u32, 222u32, 225u32, 230u32, 231u32, 232u32,
33434 233u32, 234u32, 235u32, 241u32, 242u32, 243u32, 244u32, 245u32, 246u32, 247u32, 248u32,
33435 249u32, 250u32, 251u32, 252u32, 253u32, 254u32, 256u32, 257u32, 258u32, 259u32, 260u32,
33436 261u32, 262u32, 263u32, 264u32, 265u32, 266u32, 267u32, 268u32, 269u32, 270u32, 271u32,
33437 275u32, 276u32, 277u32, 280u32, 281u32, 282u32, 283u32, 284u32, 285u32, 286u32, 287u32,
33438 288u32, 290u32, 291u32, 299u32, 300u32, 301u32, 310u32, 311u32, 320u32, 321u32, 322u32,
33439 323u32, 324u32, 330u32, 331u32, 332u32, 333u32, 334u32, 335u32, 336u32, 339u32, 340u32,
33440 350u32, 360u32, 370u32, 371u32, 372u32, 373u32, 375u32, 380u32, 385u32, 386u32, 387u32,
33441 388u32, 390u32, 395u32, 396u32, 397u32, 400u32, 401u32, 410u32, 411u32, 412u32, 413u32,
33442 435u32, 436u32, 437u32, 440u32, 9000u32, 9005u32, 12900u32, 12901u32, 12902u32,
33443 12903u32, 12904u32, 12905u32, 12915u32, 12918u32, 12919u32, 12920u32,
33444 ]
33445 }
33446}
33447impl Message for MavMessage {
33448 fn parse(
33449 version: MavlinkVersion,
33450 id: u32,
33451 payload: &[u8],
33452 ) -> Result<Self, ::mavlink_core::error::ParserError> {
33453 match id {
33454 ACTUATOR_CONTROL_TARGET_DATA::ID => {
33455 ACTUATOR_CONTROL_TARGET_DATA::deser(version, payload)
33456 .map(Self::ACTUATOR_CONTROL_TARGET)
33457 }
33458 ACTUATOR_OUTPUT_STATUS_DATA::ID => ACTUATOR_OUTPUT_STATUS_DATA::deser(version, payload)
33459 .map(Self::ACTUATOR_OUTPUT_STATUS),
33460 ADSB_VEHICLE_DATA::ID => {
33461 ADSB_VEHICLE_DATA::deser(version, payload).map(Self::ADSB_VEHICLE)
33462 }
33463 AIS_VESSEL_DATA::ID => AIS_VESSEL_DATA::deser(version, payload).map(Self::AIS_VESSEL),
33464 ALTITUDE_DATA::ID => ALTITUDE_DATA::deser(version, payload).map(Self::ALTITUDE),
33465 ATTITUDE_DATA::ID => ATTITUDE_DATA::deser(version, payload).map(Self::ATTITUDE),
33466 ATTITUDE_QUATERNION_DATA::ID => {
33467 ATTITUDE_QUATERNION_DATA::deser(version, payload).map(Self::ATTITUDE_QUATERNION)
33468 }
33469 ATTITUDE_QUATERNION_COV_DATA::ID => {
33470 ATTITUDE_QUATERNION_COV_DATA::deser(version, payload)
33471 .map(Self::ATTITUDE_QUATERNION_COV)
33472 }
33473 ATTITUDE_TARGET_DATA::ID => {
33474 ATTITUDE_TARGET_DATA::deser(version, payload).map(Self::ATTITUDE_TARGET)
33475 }
33476 ATT_POS_MOCAP_DATA::ID => {
33477 ATT_POS_MOCAP_DATA::deser(version, payload).map(Self::ATT_POS_MOCAP)
33478 }
33479 AUTH_KEY_DATA::ID => AUTH_KEY_DATA::deser(version, payload).map(Self::AUTH_KEY),
33480 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
33481 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::deser(version, payload)
33482 .map(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE)
33483 }
33484 AUTOPILOT_VERSION_DATA::ID => {
33485 AUTOPILOT_VERSION_DATA::deser(version, payload).map(Self::AUTOPILOT_VERSION)
33486 }
33487 AVAILABLE_MODES_DATA::ID => {
33488 AVAILABLE_MODES_DATA::deser(version, payload).map(Self::AVAILABLE_MODES)
33489 }
33490 AVAILABLE_MODES_MONITOR_DATA::ID => {
33491 AVAILABLE_MODES_MONITOR_DATA::deser(version, payload)
33492 .map(Self::AVAILABLE_MODES_MONITOR)
33493 }
33494 BATTERY_INFO_DATA::ID => {
33495 BATTERY_INFO_DATA::deser(version, payload).map(Self::BATTERY_INFO)
33496 }
33497 BATTERY_STATUS_DATA::ID => {
33498 BATTERY_STATUS_DATA::deser(version, payload).map(Self::BATTERY_STATUS)
33499 }
33500 BUTTON_CHANGE_DATA::ID => {
33501 BUTTON_CHANGE_DATA::deser(version, payload).map(Self::BUTTON_CHANGE)
33502 }
33503 CAMERA_CAPTURE_STATUS_DATA::ID => {
33504 CAMERA_CAPTURE_STATUS_DATA::deser(version, payload).map(Self::CAMERA_CAPTURE_STATUS)
33505 }
33506 CAMERA_FOV_STATUS_DATA::ID => {
33507 CAMERA_FOV_STATUS_DATA::deser(version, payload).map(Self::CAMERA_FOV_STATUS)
33508 }
33509 CAMERA_IMAGE_CAPTURED_DATA::ID => {
33510 CAMERA_IMAGE_CAPTURED_DATA::deser(version, payload).map(Self::CAMERA_IMAGE_CAPTURED)
33511 }
33512 CAMERA_INFORMATION_DATA::ID => {
33513 CAMERA_INFORMATION_DATA::deser(version, payload).map(Self::CAMERA_INFORMATION)
33514 }
33515 CAMERA_SETTINGS_DATA::ID => {
33516 CAMERA_SETTINGS_DATA::deser(version, payload).map(Self::CAMERA_SETTINGS)
33517 }
33518 CAMERA_THERMAL_RANGE_DATA::ID => {
33519 CAMERA_THERMAL_RANGE_DATA::deser(version, payload).map(Self::CAMERA_THERMAL_RANGE)
33520 }
33521 CAMERA_TRACKING_GEO_STATUS_DATA::ID => {
33522 CAMERA_TRACKING_GEO_STATUS_DATA::deser(version, payload)
33523 .map(Self::CAMERA_TRACKING_GEO_STATUS)
33524 }
33525 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => {
33526 CAMERA_TRACKING_IMAGE_STATUS_DATA::deser(version, payload)
33527 .map(Self::CAMERA_TRACKING_IMAGE_STATUS)
33528 }
33529 CAMERA_TRIGGER_DATA::ID => {
33530 CAMERA_TRIGGER_DATA::deser(version, payload).map(Self::CAMERA_TRIGGER)
33531 }
33532 CANFD_FRAME_DATA::ID => {
33533 CANFD_FRAME_DATA::deser(version, payload).map(Self::CANFD_FRAME)
33534 }
33535 CAN_FILTER_MODIFY_DATA::ID => {
33536 CAN_FILTER_MODIFY_DATA::deser(version, payload).map(Self::CAN_FILTER_MODIFY)
33537 }
33538 CAN_FRAME_DATA::ID => CAN_FRAME_DATA::deser(version, payload).map(Self::CAN_FRAME),
33539 CELLULAR_CONFIG_DATA::ID => {
33540 CELLULAR_CONFIG_DATA::deser(version, payload).map(Self::CELLULAR_CONFIG)
33541 }
33542 CELLULAR_STATUS_DATA::ID => {
33543 CELLULAR_STATUS_DATA::deser(version, payload).map(Self::CELLULAR_STATUS)
33544 }
33545 CHANGE_OPERATOR_CONTROL_DATA::ID => {
33546 CHANGE_OPERATOR_CONTROL_DATA::deser(version, payload)
33547 .map(Self::CHANGE_OPERATOR_CONTROL)
33548 }
33549 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => {
33550 CHANGE_OPERATOR_CONTROL_ACK_DATA::deser(version, payload)
33551 .map(Self::CHANGE_OPERATOR_CONTROL_ACK)
33552 }
33553 COLLISION_DATA::ID => COLLISION_DATA::deser(version, payload).map(Self::COLLISION),
33554 COMMAND_ACK_DATA::ID => {
33555 COMMAND_ACK_DATA::deser(version, payload).map(Self::COMMAND_ACK)
33556 }
33557 COMMAND_CANCEL_DATA::ID => {
33558 COMMAND_CANCEL_DATA::deser(version, payload).map(Self::COMMAND_CANCEL)
33559 }
33560 COMMAND_INT_DATA::ID => {
33561 COMMAND_INT_DATA::deser(version, payload).map(Self::COMMAND_INT)
33562 }
33563 COMMAND_LONG_DATA::ID => {
33564 COMMAND_LONG_DATA::deser(version, payload).map(Self::COMMAND_LONG)
33565 }
33566 COMPONENT_INFORMATION_DATA::ID => {
33567 COMPONENT_INFORMATION_DATA::deser(version, payload).map(Self::COMPONENT_INFORMATION)
33568 }
33569 COMPONENT_INFORMATION_BASIC_DATA::ID => {
33570 COMPONENT_INFORMATION_BASIC_DATA::deser(version, payload)
33571 .map(Self::COMPONENT_INFORMATION_BASIC)
33572 }
33573 COMPONENT_METADATA_DATA::ID => {
33574 COMPONENT_METADATA_DATA::deser(version, payload).map(Self::COMPONENT_METADATA)
33575 }
33576 CONTROL_SYSTEM_STATE_DATA::ID => {
33577 CONTROL_SYSTEM_STATE_DATA::deser(version, payload).map(Self::CONTROL_SYSTEM_STATE)
33578 }
33579 CURRENT_EVENT_SEQUENCE_DATA::ID => CURRENT_EVENT_SEQUENCE_DATA::deser(version, payload)
33580 .map(Self::CURRENT_EVENT_SEQUENCE),
33581 CURRENT_MODE_DATA::ID => {
33582 CURRENT_MODE_DATA::deser(version, payload).map(Self::CURRENT_MODE)
33583 }
33584 DATA_STREAM_DATA::ID => {
33585 DATA_STREAM_DATA::deser(version, payload).map(Self::DATA_STREAM)
33586 }
33587 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => {
33588 DATA_TRANSMISSION_HANDSHAKE_DATA::deser(version, payload)
33589 .map(Self::DATA_TRANSMISSION_HANDSHAKE)
33590 }
33591 DEBUG_DATA::ID => DEBUG_DATA::deser(version, payload).map(Self::DEBUG),
33592 DEBUG_FLOAT_ARRAY_DATA::ID => {
33593 DEBUG_FLOAT_ARRAY_DATA::deser(version, payload).map(Self::DEBUG_FLOAT_ARRAY)
33594 }
33595 DEBUG_VECT_DATA::ID => DEBUG_VECT_DATA::deser(version, payload).map(Self::DEBUG_VECT),
33596 DISTANCE_SENSOR_DATA::ID => {
33597 DISTANCE_SENSOR_DATA::deser(version, payload).map(Self::DISTANCE_SENSOR)
33598 }
33599 EFI_STATUS_DATA::ID => EFI_STATUS_DATA::deser(version, payload).map(Self::EFI_STATUS),
33600 ENCAPSULATED_DATA_DATA::ID => {
33601 ENCAPSULATED_DATA_DATA::deser(version, payload).map(Self::ENCAPSULATED_DATA)
33602 }
33603 ESC_INFO_DATA::ID => ESC_INFO_DATA::deser(version, payload).map(Self::ESC_INFO),
33604 ESC_STATUS_DATA::ID => ESC_STATUS_DATA::deser(version, payload).map(Self::ESC_STATUS),
33605 ESTIMATOR_STATUS_DATA::ID => {
33606 ESTIMATOR_STATUS_DATA::deser(version, payload).map(Self::ESTIMATOR_STATUS)
33607 }
33608 EVENT_DATA::ID => EVENT_DATA::deser(version, payload).map(Self::EVENT),
33609 EXTENDED_SYS_STATE_DATA::ID => {
33610 EXTENDED_SYS_STATE_DATA::deser(version, payload).map(Self::EXTENDED_SYS_STATE)
33611 }
33612 FENCE_STATUS_DATA::ID => {
33613 FENCE_STATUS_DATA::deser(version, payload).map(Self::FENCE_STATUS)
33614 }
33615 FILE_TRANSFER_PROTOCOL_DATA::ID => FILE_TRANSFER_PROTOCOL_DATA::deser(version, payload)
33616 .map(Self::FILE_TRANSFER_PROTOCOL),
33617 FLIGHT_INFORMATION_DATA::ID => {
33618 FLIGHT_INFORMATION_DATA::deser(version, payload).map(Self::FLIGHT_INFORMATION)
33619 }
33620 FOLLOW_TARGET_DATA::ID => {
33621 FOLLOW_TARGET_DATA::deser(version, payload).map(Self::FOLLOW_TARGET)
33622 }
33623 FUEL_STATUS_DATA::ID => {
33624 FUEL_STATUS_DATA::deser(version, payload).map(Self::FUEL_STATUS)
33625 }
33626 GENERATOR_STATUS_DATA::ID => {
33627 GENERATOR_STATUS_DATA::deser(version, payload).map(Self::GENERATOR_STATUS)
33628 }
33629 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => {
33630 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::deser(version, payload)
33631 .map(Self::GIMBAL_DEVICE_ATTITUDE_STATUS)
33632 }
33633 GIMBAL_DEVICE_INFORMATION_DATA::ID => {
33634 GIMBAL_DEVICE_INFORMATION_DATA::deser(version, payload)
33635 .map(Self::GIMBAL_DEVICE_INFORMATION)
33636 }
33637 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => {
33638 GIMBAL_DEVICE_SET_ATTITUDE_DATA::deser(version, payload)
33639 .map(Self::GIMBAL_DEVICE_SET_ATTITUDE)
33640 }
33641 GIMBAL_MANAGER_INFORMATION_DATA::ID => {
33642 GIMBAL_MANAGER_INFORMATION_DATA::deser(version, payload)
33643 .map(Self::GIMBAL_MANAGER_INFORMATION)
33644 }
33645 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => {
33646 GIMBAL_MANAGER_SET_ATTITUDE_DATA::deser(version, payload)
33647 .map(Self::GIMBAL_MANAGER_SET_ATTITUDE)
33648 }
33649 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
33650 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::deser(version, payload)
33651 .map(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL)
33652 }
33653 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => {
33654 GIMBAL_MANAGER_SET_PITCHYAW_DATA::deser(version, payload)
33655 .map(Self::GIMBAL_MANAGER_SET_PITCHYAW)
33656 }
33657 GIMBAL_MANAGER_STATUS_DATA::ID => {
33658 GIMBAL_MANAGER_STATUS_DATA::deser(version, payload).map(Self::GIMBAL_MANAGER_STATUS)
33659 }
33660 GLOBAL_POSITION_INT_DATA::ID => {
33661 GLOBAL_POSITION_INT_DATA::deser(version, payload).map(Self::GLOBAL_POSITION_INT)
33662 }
33663 GLOBAL_POSITION_INT_COV_DATA::ID => {
33664 GLOBAL_POSITION_INT_COV_DATA::deser(version, payload)
33665 .map(Self::GLOBAL_POSITION_INT_COV)
33666 }
33667 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
33668 GLOBAL_VISION_POSITION_ESTIMATE_DATA::deser(version, payload)
33669 .map(Self::GLOBAL_VISION_POSITION_ESTIMATE)
33670 }
33671 GPS2_RAW_DATA::ID => GPS2_RAW_DATA::deser(version, payload).map(Self::GPS2_RAW),
33672 GPS2_RTK_DATA::ID => GPS2_RTK_DATA::deser(version, payload).map(Self::GPS2_RTK),
33673 GPS_GLOBAL_ORIGIN_DATA::ID => {
33674 GPS_GLOBAL_ORIGIN_DATA::deser(version, payload).map(Self::GPS_GLOBAL_ORIGIN)
33675 }
33676 GPS_INJECT_DATA_DATA::ID => {
33677 GPS_INJECT_DATA_DATA::deser(version, payload).map(Self::GPS_INJECT_DATA)
33678 }
33679 GPS_INPUT_DATA::ID => GPS_INPUT_DATA::deser(version, payload).map(Self::GPS_INPUT),
33680 GPS_RAW_INT_DATA::ID => {
33681 GPS_RAW_INT_DATA::deser(version, payload).map(Self::GPS_RAW_INT)
33682 }
33683 GPS_RTCM_DATA_DATA::ID => {
33684 GPS_RTCM_DATA_DATA::deser(version, payload).map(Self::GPS_RTCM_DATA)
33685 }
33686 GPS_RTK_DATA::ID => GPS_RTK_DATA::deser(version, payload).map(Self::GPS_RTK),
33687 GPS_STATUS_DATA::ID => GPS_STATUS_DATA::deser(version, payload).map(Self::GPS_STATUS),
33688 HEARTBEAT_DATA::ID => HEARTBEAT_DATA::deser(version, payload).map(Self::HEARTBEAT),
33689 HIGHRES_IMU_DATA::ID => {
33690 HIGHRES_IMU_DATA::deser(version, payload).map(Self::HIGHRES_IMU)
33691 }
33692 HIGH_LATENCY_DATA::ID => {
33693 HIGH_LATENCY_DATA::deser(version, payload).map(Self::HIGH_LATENCY)
33694 }
33695 HIGH_LATENCY2_DATA::ID => {
33696 HIGH_LATENCY2_DATA::deser(version, payload).map(Self::HIGH_LATENCY2)
33697 }
33698 HIL_ACTUATOR_CONTROLS_DATA::ID => {
33699 HIL_ACTUATOR_CONTROLS_DATA::deser(version, payload).map(Self::HIL_ACTUATOR_CONTROLS)
33700 }
33701 HIL_CONTROLS_DATA::ID => {
33702 HIL_CONTROLS_DATA::deser(version, payload).map(Self::HIL_CONTROLS)
33703 }
33704 HIL_GPS_DATA::ID => HIL_GPS_DATA::deser(version, payload).map(Self::HIL_GPS),
33705 HIL_OPTICAL_FLOW_DATA::ID => {
33706 HIL_OPTICAL_FLOW_DATA::deser(version, payload).map(Self::HIL_OPTICAL_FLOW)
33707 }
33708 HIL_RC_INPUTS_RAW_DATA::ID => {
33709 HIL_RC_INPUTS_RAW_DATA::deser(version, payload).map(Self::HIL_RC_INPUTS_RAW)
33710 }
33711 HIL_SENSOR_DATA::ID => HIL_SENSOR_DATA::deser(version, payload).map(Self::HIL_SENSOR),
33712 HIL_STATE_DATA::ID => HIL_STATE_DATA::deser(version, payload).map(Self::HIL_STATE),
33713 HIL_STATE_QUATERNION_DATA::ID => {
33714 HIL_STATE_QUATERNION_DATA::deser(version, payload).map(Self::HIL_STATE_QUATERNION)
33715 }
33716 HOME_POSITION_DATA::ID => {
33717 HOME_POSITION_DATA::deser(version, payload).map(Self::HOME_POSITION)
33718 }
33719 HYGROMETER_SENSOR_DATA::ID => {
33720 HYGROMETER_SENSOR_DATA::deser(version, payload).map(Self::HYGROMETER_SENSOR)
33721 }
33722 ILLUMINATOR_STATUS_DATA::ID => {
33723 ILLUMINATOR_STATUS_DATA::deser(version, payload).map(Self::ILLUMINATOR_STATUS)
33724 }
33725 ISBD_LINK_STATUS_DATA::ID => {
33726 ISBD_LINK_STATUS_DATA::deser(version, payload).map(Self::ISBD_LINK_STATUS)
33727 }
33728 LANDING_TARGET_DATA::ID => {
33729 LANDING_TARGET_DATA::deser(version, payload).map(Self::LANDING_TARGET)
33730 }
33731 LINK_NODE_STATUS_DATA::ID => {
33732 LINK_NODE_STATUS_DATA::deser(version, payload).map(Self::LINK_NODE_STATUS)
33733 }
33734 LOCAL_POSITION_NED_DATA::ID => {
33735 LOCAL_POSITION_NED_DATA::deser(version, payload).map(Self::LOCAL_POSITION_NED)
33736 }
33737 LOCAL_POSITION_NED_COV_DATA::ID => LOCAL_POSITION_NED_COV_DATA::deser(version, payload)
33738 .map(Self::LOCAL_POSITION_NED_COV),
33739 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
33740 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::deser(version, payload)
33741 .map(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET)
33742 }
33743 LOGGING_ACK_DATA::ID => {
33744 LOGGING_ACK_DATA::deser(version, payload).map(Self::LOGGING_ACK)
33745 }
33746 LOGGING_DATA_DATA::ID => {
33747 LOGGING_DATA_DATA::deser(version, payload).map(Self::LOGGING_DATA)
33748 }
33749 LOGGING_DATA_ACKED_DATA::ID => {
33750 LOGGING_DATA_ACKED_DATA::deser(version, payload).map(Self::LOGGING_DATA_ACKED)
33751 }
33752 LOG_DATA_DATA::ID => LOG_DATA_DATA::deser(version, payload).map(Self::LOG_DATA),
33753 LOG_ENTRY_DATA::ID => LOG_ENTRY_DATA::deser(version, payload).map(Self::LOG_ENTRY),
33754 LOG_ERASE_DATA::ID => LOG_ERASE_DATA::deser(version, payload).map(Self::LOG_ERASE),
33755 LOG_REQUEST_DATA_DATA::ID => {
33756 LOG_REQUEST_DATA_DATA::deser(version, payload).map(Self::LOG_REQUEST_DATA)
33757 }
33758 LOG_REQUEST_END_DATA::ID => {
33759 LOG_REQUEST_END_DATA::deser(version, payload).map(Self::LOG_REQUEST_END)
33760 }
33761 LOG_REQUEST_LIST_DATA::ID => {
33762 LOG_REQUEST_LIST_DATA::deser(version, payload).map(Self::LOG_REQUEST_LIST)
33763 }
33764 MAG_CAL_REPORT_DATA::ID => {
33765 MAG_CAL_REPORT_DATA::deser(version, payload).map(Self::MAG_CAL_REPORT)
33766 }
33767 MANUAL_CONTROL_DATA::ID => {
33768 MANUAL_CONTROL_DATA::deser(version, payload).map(Self::MANUAL_CONTROL)
33769 }
33770 MANUAL_SETPOINT_DATA::ID => {
33771 MANUAL_SETPOINT_DATA::deser(version, payload).map(Self::MANUAL_SETPOINT)
33772 }
33773 MEMORY_VECT_DATA::ID => {
33774 MEMORY_VECT_DATA::deser(version, payload).map(Self::MEMORY_VECT)
33775 }
33776 MESSAGE_INTERVAL_DATA::ID => {
33777 MESSAGE_INTERVAL_DATA::deser(version, payload).map(Self::MESSAGE_INTERVAL)
33778 }
33779 MISSION_ACK_DATA::ID => {
33780 MISSION_ACK_DATA::deser(version, payload).map(Self::MISSION_ACK)
33781 }
33782 MISSION_CLEAR_ALL_DATA::ID => {
33783 MISSION_CLEAR_ALL_DATA::deser(version, payload).map(Self::MISSION_CLEAR_ALL)
33784 }
33785 MISSION_COUNT_DATA::ID => {
33786 MISSION_COUNT_DATA::deser(version, payload).map(Self::MISSION_COUNT)
33787 }
33788 MISSION_CURRENT_DATA::ID => {
33789 MISSION_CURRENT_DATA::deser(version, payload).map(Self::MISSION_CURRENT)
33790 }
33791 MISSION_ITEM_DATA::ID => {
33792 MISSION_ITEM_DATA::deser(version, payload).map(Self::MISSION_ITEM)
33793 }
33794 MISSION_ITEM_INT_DATA::ID => {
33795 MISSION_ITEM_INT_DATA::deser(version, payload).map(Self::MISSION_ITEM_INT)
33796 }
33797 MISSION_ITEM_REACHED_DATA::ID => {
33798 MISSION_ITEM_REACHED_DATA::deser(version, payload).map(Self::MISSION_ITEM_REACHED)
33799 }
33800 MISSION_REQUEST_DATA::ID => {
33801 MISSION_REQUEST_DATA::deser(version, payload).map(Self::MISSION_REQUEST)
33802 }
33803 MISSION_REQUEST_INT_DATA::ID => {
33804 MISSION_REQUEST_INT_DATA::deser(version, payload).map(Self::MISSION_REQUEST_INT)
33805 }
33806 MISSION_REQUEST_LIST_DATA::ID => {
33807 MISSION_REQUEST_LIST_DATA::deser(version, payload).map(Self::MISSION_REQUEST_LIST)
33808 }
33809 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => {
33810 MISSION_REQUEST_PARTIAL_LIST_DATA::deser(version, payload)
33811 .map(Self::MISSION_REQUEST_PARTIAL_LIST)
33812 }
33813 MISSION_SET_CURRENT_DATA::ID => {
33814 MISSION_SET_CURRENT_DATA::deser(version, payload).map(Self::MISSION_SET_CURRENT)
33815 }
33816 MISSION_WRITE_PARTIAL_LIST_DATA::ID => {
33817 MISSION_WRITE_PARTIAL_LIST_DATA::deser(version, payload)
33818 .map(Self::MISSION_WRITE_PARTIAL_LIST)
33819 }
33820 MOUNT_ORIENTATION_DATA::ID => {
33821 MOUNT_ORIENTATION_DATA::deser(version, payload).map(Self::MOUNT_ORIENTATION)
33822 }
33823 NAMED_VALUE_FLOAT_DATA::ID => {
33824 NAMED_VALUE_FLOAT_DATA::deser(version, payload).map(Self::NAMED_VALUE_FLOAT)
33825 }
33826 NAMED_VALUE_INT_DATA::ID => {
33827 NAMED_VALUE_INT_DATA::deser(version, payload).map(Self::NAMED_VALUE_INT)
33828 }
33829 NAV_CONTROLLER_OUTPUT_DATA::ID => {
33830 NAV_CONTROLLER_OUTPUT_DATA::deser(version, payload).map(Self::NAV_CONTROLLER_OUTPUT)
33831 }
33832 NAV_FILTER_BIAS_DATA::ID => {
33833 NAV_FILTER_BIAS_DATA::deser(version, payload).map(Self::NAV_FILTER_BIAS)
33834 }
33835 OBSTACLE_DISTANCE_DATA::ID => {
33836 OBSTACLE_DISTANCE_DATA::deser(version, payload).map(Self::OBSTACLE_DISTANCE)
33837 }
33838 ODOMETRY_DATA::ID => ODOMETRY_DATA::deser(version, payload).map(Self::ODOMETRY),
33839 ONBOARD_COMPUTER_STATUS_DATA::ID => {
33840 ONBOARD_COMPUTER_STATUS_DATA::deser(version, payload)
33841 .map(Self::ONBOARD_COMPUTER_STATUS)
33842 }
33843 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => {
33844 OPEN_DRONE_ID_ARM_STATUS_DATA::deser(version, payload)
33845 .map(Self::OPEN_DRONE_ID_ARM_STATUS)
33846 }
33847 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => {
33848 OPEN_DRONE_ID_AUTHENTICATION_DATA::deser(version, payload)
33849 .map(Self::OPEN_DRONE_ID_AUTHENTICATION)
33850 }
33851 OPEN_DRONE_ID_BASIC_ID_DATA::ID => OPEN_DRONE_ID_BASIC_ID_DATA::deser(version, payload)
33852 .map(Self::OPEN_DRONE_ID_BASIC_ID),
33853 OPEN_DRONE_ID_LOCATION_DATA::ID => OPEN_DRONE_ID_LOCATION_DATA::deser(version, payload)
33854 .map(Self::OPEN_DRONE_ID_LOCATION),
33855 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => {
33856 OPEN_DRONE_ID_MESSAGE_PACK_DATA::deser(version, payload)
33857 .map(Self::OPEN_DRONE_ID_MESSAGE_PACK)
33858 }
33859 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => {
33860 OPEN_DRONE_ID_OPERATOR_ID_DATA::deser(version, payload)
33861 .map(Self::OPEN_DRONE_ID_OPERATOR_ID)
33862 }
33863 OPEN_DRONE_ID_SELF_ID_DATA::ID => {
33864 OPEN_DRONE_ID_SELF_ID_DATA::deser(version, payload).map(Self::OPEN_DRONE_ID_SELF_ID)
33865 }
33866 OPEN_DRONE_ID_SYSTEM_DATA::ID => {
33867 OPEN_DRONE_ID_SYSTEM_DATA::deser(version, payload).map(Self::OPEN_DRONE_ID_SYSTEM)
33868 }
33869 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => {
33870 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::deser(version, payload)
33871 .map(Self::OPEN_DRONE_ID_SYSTEM_UPDATE)
33872 }
33873 OPTICAL_FLOW_DATA::ID => {
33874 OPTICAL_FLOW_DATA::deser(version, payload).map(Self::OPTICAL_FLOW)
33875 }
33876 OPTICAL_FLOW_RAD_DATA::ID => {
33877 OPTICAL_FLOW_RAD_DATA::deser(version, payload).map(Self::OPTICAL_FLOW_RAD)
33878 }
33879 ORBIT_EXECUTION_STATUS_DATA::ID => ORBIT_EXECUTION_STATUS_DATA::deser(version, payload)
33880 .map(Self::ORBIT_EXECUTION_STATUS),
33881 PARAM_EXT_ACK_DATA::ID => {
33882 PARAM_EXT_ACK_DATA::deser(version, payload).map(Self::PARAM_EXT_ACK)
33883 }
33884 PARAM_EXT_REQUEST_LIST_DATA::ID => PARAM_EXT_REQUEST_LIST_DATA::deser(version, payload)
33885 .map(Self::PARAM_EXT_REQUEST_LIST),
33886 PARAM_EXT_REQUEST_READ_DATA::ID => PARAM_EXT_REQUEST_READ_DATA::deser(version, payload)
33887 .map(Self::PARAM_EXT_REQUEST_READ),
33888 PARAM_EXT_SET_DATA::ID => {
33889 PARAM_EXT_SET_DATA::deser(version, payload).map(Self::PARAM_EXT_SET)
33890 }
33891 PARAM_EXT_VALUE_DATA::ID => {
33892 PARAM_EXT_VALUE_DATA::deser(version, payload).map(Self::PARAM_EXT_VALUE)
33893 }
33894 PARAM_MAP_RC_DATA::ID => {
33895 PARAM_MAP_RC_DATA::deser(version, payload).map(Self::PARAM_MAP_RC)
33896 }
33897 PARAM_REQUEST_LIST_DATA::ID => {
33898 PARAM_REQUEST_LIST_DATA::deser(version, payload).map(Self::PARAM_REQUEST_LIST)
33899 }
33900 PARAM_REQUEST_READ_DATA::ID => {
33901 PARAM_REQUEST_READ_DATA::deser(version, payload).map(Self::PARAM_REQUEST_READ)
33902 }
33903 PARAM_SET_DATA::ID => PARAM_SET_DATA::deser(version, payload).map(Self::PARAM_SET),
33904 PARAM_VALUE_DATA::ID => {
33905 PARAM_VALUE_DATA::deser(version, payload).map(Self::PARAM_VALUE)
33906 }
33907 PING_DATA::ID => PING_DATA::deser(version, payload).map(Self::PING),
33908 PLAY_TUNE_DATA::ID => PLAY_TUNE_DATA::deser(version, payload).map(Self::PLAY_TUNE),
33909 PLAY_TUNE_V2_DATA::ID => {
33910 PLAY_TUNE_V2_DATA::deser(version, payload).map(Self::PLAY_TUNE_V2)
33911 }
33912 POSITION_TARGET_GLOBAL_INT_DATA::ID => {
33913 POSITION_TARGET_GLOBAL_INT_DATA::deser(version, payload)
33914 .map(Self::POSITION_TARGET_GLOBAL_INT)
33915 }
33916 POSITION_TARGET_LOCAL_NED_DATA::ID => {
33917 POSITION_TARGET_LOCAL_NED_DATA::deser(version, payload)
33918 .map(Self::POSITION_TARGET_LOCAL_NED)
33919 }
33920 POWER_STATUS_DATA::ID => {
33921 POWER_STATUS_DATA::deser(version, payload).map(Self::POWER_STATUS)
33922 }
33923 PROTOCOL_VERSION_DATA::ID => {
33924 PROTOCOL_VERSION_DATA::deser(version, payload).map(Self::PROTOCOL_VERSION)
33925 }
33926 RADIO_CALIBRATION_DATA::ID => {
33927 RADIO_CALIBRATION_DATA::deser(version, payload).map(Self::RADIO_CALIBRATION)
33928 }
33929 RADIO_STATUS_DATA::ID => {
33930 RADIO_STATUS_DATA::deser(version, payload).map(Self::RADIO_STATUS)
33931 }
33932 RAW_IMU_DATA::ID => RAW_IMU_DATA::deser(version, payload).map(Self::RAW_IMU),
33933 RAW_PRESSURE_DATA::ID => {
33934 RAW_PRESSURE_DATA::deser(version, payload).map(Self::RAW_PRESSURE)
33935 }
33936 RAW_RPM_DATA::ID => RAW_RPM_DATA::deser(version, payload).map(Self::RAW_RPM),
33937 RC_CHANNELS_DATA::ID => {
33938 RC_CHANNELS_DATA::deser(version, payload).map(Self::RC_CHANNELS)
33939 }
33940 RC_CHANNELS_OVERRIDE_DATA::ID => {
33941 RC_CHANNELS_OVERRIDE_DATA::deser(version, payload).map(Self::RC_CHANNELS_OVERRIDE)
33942 }
33943 RC_CHANNELS_RAW_DATA::ID => {
33944 RC_CHANNELS_RAW_DATA::deser(version, payload).map(Self::RC_CHANNELS_RAW)
33945 }
33946 RC_CHANNELS_SCALED_DATA::ID => {
33947 RC_CHANNELS_SCALED_DATA::deser(version, payload).map(Self::RC_CHANNELS_SCALED)
33948 }
33949 REQUEST_DATA_STREAM_DATA::ID => {
33950 REQUEST_DATA_STREAM_DATA::deser(version, payload).map(Self::REQUEST_DATA_STREAM)
33951 }
33952 REQUEST_EVENT_DATA::ID => {
33953 REQUEST_EVENT_DATA::deser(version, payload).map(Self::REQUEST_EVENT)
33954 }
33955 RESOURCE_REQUEST_DATA::ID => {
33956 RESOURCE_REQUEST_DATA::deser(version, payload).map(Self::RESOURCE_REQUEST)
33957 }
33958 RESPONSE_EVENT_ERROR_DATA::ID => {
33959 RESPONSE_EVENT_ERROR_DATA::deser(version, payload).map(Self::RESPONSE_EVENT_ERROR)
33960 }
33961 SAFETY_ALLOWED_AREA_DATA::ID => {
33962 SAFETY_ALLOWED_AREA_DATA::deser(version, payload).map(Self::SAFETY_ALLOWED_AREA)
33963 }
33964 SAFETY_SET_ALLOWED_AREA_DATA::ID => {
33965 SAFETY_SET_ALLOWED_AREA_DATA::deser(version, payload)
33966 .map(Self::SAFETY_SET_ALLOWED_AREA)
33967 }
33968 SCALED_IMU_DATA::ID => SCALED_IMU_DATA::deser(version, payload).map(Self::SCALED_IMU),
33969 SCALED_IMU2_DATA::ID => {
33970 SCALED_IMU2_DATA::deser(version, payload).map(Self::SCALED_IMU2)
33971 }
33972 SCALED_IMU3_DATA::ID => {
33973 SCALED_IMU3_DATA::deser(version, payload).map(Self::SCALED_IMU3)
33974 }
33975 SCALED_PRESSURE_DATA::ID => {
33976 SCALED_PRESSURE_DATA::deser(version, payload).map(Self::SCALED_PRESSURE)
33977 }
33978 SCALED_PRESSURE2_DATA::ID => {
33979 SCALED_PRESSURE2_DATA::deser(version, payload).map(Self::SCALED_PRESSURE2)
33980 }
33981 SCALED_PRESSURE3_DATA::ID => {
33982 SCALED_PRESSURE3_DATA::deser(version, payload).map(Self::SCALED_PRESSURE3)
33983 }
33984 SERIAL_CONTROL_DATA::ID => {
33985 SERIAL_CONTROL_DATA::deser(version, payload).map(Self::SERIAL_CONTROL)
33986 }
33987 SERVO_OUTPUT_RAW_DATA::ID => {
33988 SERVO_OUTPUT_RAW_DATA::deser(version, payload).map(Self::SERVO_OUTPUT_RAW)
33989 }
33990 SETUP_SIGNING_DATA::ID => {
33991 SETUP_SIGNING_DATA::deser(version, payload).map(Self::SETUP_SIGNING)
33992 }
33993 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => {
33994 SET_ACTUATOR_CONTROL_TARGET_DATA::deser(version, payload)
33995 .map(Self::SET_ACTUATOR_CONTROL_TARGET)
33996 }
33997 SET_ATTITUDE_TARGET_DATA::ID => {
33998 SET_ATTITUDE_TARGET_DATA::deser(version, payload).map(Self::SET_ATTITUDE_TARGET)
33999 }
34000 SET_GPS_GLOBAL_ORIGIN_DATA::ID => {
34001 SET_GPS_GLOBAL_ORIGIN_DATA::deser(version, payload).map(Self::SET_GPS_GLOBAL_ORIGIN)
34002 }
34003 SET_HOME_POSITION_DATA::ID => {
34004 SET_HOME_POSITION_DATA::deser(version, payload).map(Self::SET_HOME_POSITION)
34005 }
34006 SET_MODE_DATA::ID => SET_MODE_DATA::deser(version, payload).map(Self::SET_MODE),
34007 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => {
34008 SET_POSITION_TARGET_GLOBAL_INT_DATA::deser(version, payload)
34009 .map(Self::SET_POSITION_TARGET_GLOBAL_INT)
34010 }
34011 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => {
34012 SET_POSITION_TARGET_LOCAL_NED_DATA::deser(version, payload)
34013 .map(Self::SET_POSITION_TARGET_LOCAL_NED)
34014 }
34015 SIM_STATE_DATA::ID => SIM_STATE_DATA::deser(version, payload).map(Self::SIM_STATE),
34016 SMART_BATTERY_INFO_DATA::ID => {
34017 SMART_BATTERY_INFO_DATA::deser(version, payload).map(Self::SMART_BATTERY_INFO)
34018 }
34019 STATUSTEXT_DATA::ID => STATUSTEXT_DATA::deser(version, payload).map(Self::STATUSTEXT),
34020 STORAGE_INFORMATION_DATA::ID => {
34021 STORAGE_INFORMATION_DATA::deser(version, payload).map(Self::STORAGE_INFORMATION)
34022 }
34023 SUPPORTED_TUNES_DATA::ID => {
34024 SUPPORTED_TUNES_DATA::deser(version, payload).map(Self::SUPPORTED_TUNES)
34025 }
34026 SYSTEM_TIME_DATA::ID => {
34027 SYSTEM_TIME_DATA::deser(version, payload).map(Self::SYSTEM_TIME)
34028 }
34029 SYS_STATUS_DATA::ID => SYS_STATUS_DATA::deser(version, payload).map(Self::SYS_STATUS),
34030 TERRAIN_CHECK_DATA::ID => {
34031 TERRAIN_CHECK_DATA::deser(version, payload).map(Self::TERRAIN_CHECK)
34032 }
34033 TERRAIN_DATA_DATA::ID => {
34034 TERRAIN_DATA_DATA::deser(version, payload).map(Self::TERRAIN_DATA)
34035 }
34036 TERRAIN_REPORT_DATA::ID => {
34037 TERRAIN_REPORT_DATA::deser(version, payload).map(Self::TERRAIN_REPORT)
34038 }
34039 TERRAIN_REQUEST_DATA::ID => {
34040 TERRAIN_REQUEST_DATA::deser(version, payload).map(Self::TERRAIN_REQUEST)
34041 }
34042 TIMESYNC_DATA::ID => TIMESYNC_DATA::deser(version, payload).map(Self::TIMESYNC),
34043 TIME_ESTIMATE_TO_TARGET_DATA::ID => {
34044 TIME_ESTIMATE_TO_TARGET_DATA::deser(version, payload)
34045 .map(Self::TIME_ESTIMATE_TO_TARGET)
34046 }
34047 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
34048 TRAJECTORY_REPRESENTATION_BEZIER_DATA::deser(version, payload)
34049 .map(Self::TRAJECTORY_REPRESENTATION_BEZIER)
34050 }
34051 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
34052 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::deser(version, payload)
34053 .map(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS)
34054 }
34055 TUNNEL_DATA::ID => TUNNEL_DATA::deser(version, payload).map(Self::TUNNEL),
34056 UALBERTA_SYS_STATUS_DATA::ID => {
34057 UALBERTA_SYS_STATUS_DATA::deser(version, payload).map(Self::UALBERTA_SYS_STATUS)
34058 }
34059 UAVCAN_NODE_INFO_DATA::ID => {
34060 UAVCAN_NODE_INFO_DATA::deser(version, payload).map(Self::UAVCAN_NODE_INFO)
34061 }
34062 UAVCAN_NODE_STATUS_DATA::ID => {
34063 UAVCAN_NODE_STATUS_DATA::deser(version, payload).map(Self::UAVCAN_NODE_STATUS)
34064 }
34065 UTM_GLOBAL_POSITION_DATA::ID => {
34066 UTM_GLOBAL_POSITION_DATA::deser(version, payload).map(Self::UTM_GLOBAL_POSITION)
34067 }
34068 V2_EXTENSION_DATA::ID => {
34069 V2_EXTENSION_DATA::deser(version, payload).map(Self::V2_EXTENSION)
34070 }
34071 VFR_HUD_DATA::ID => VFR_HUD_DATA::deser(version, payload).map(Self::VFR_HUD),
34072 VIBRATION_DATA::ID => VIBRATION_DATA::deser(version, payload).map(Self::VIBRATION),
34073 VICON_POSITION_ESTIMATE_DATA::ID => {
34074 VICON_POSITION_ESTIMATE_DATA::deser(version, payload)
34075 .map(Self::VICON_POSITION_ESTIMATE)
34076 }
34077 VIDEO_STREAM_INFORMATION_DATA::ID => {
34078 VIDEO_STREAM_INFORMATION_DATA::deser(version, payload)
34079 .map(Self::VIDEO_STREAM_INFORMATION)
34080 }
34081 VIDEO_STREAM_STATUS_DATA::ID => {
34082 VIDEO_STREAM_STATUS_DATA::deser(version, payload).map(Self::VIDEO_STREAM_STATUS)
34083 }
34084 VISION_POSITION_ESTIMATE_DATA::ID => {
34085 VISION_POSITION_ESTIMATE_DATA::deser(version, payload)
34086 .map(Self::VISION_POSITION_ESTIMATE)
34087 }
34088 VISION_SPEED_ESTIMATE_DATA::ID => {
34089 VISION_SPEED_ESTIMATE_DATA::deser(version, payload).map(Self::VISION_SPEED_ESTIMATE)
34090 }
34091 WHEEL_DISTANCE_DATA::ID => {
34092 WHEEL_DISTANCE_DATA::deser(version, payload).map(Self::WHEEL_DISTANCE)
34093 }
34094 WIFI_CONFIG_AP_DATA::ID => {
34095 WIFI_CONFIG_AP_DATA::deser(version, payload).map(Self::WIFI_CONFIG_AP)
34096 }
34097 WINCH_STATUS_DATA::ID => {
34098 WINCH_STATUS_DATA::deser(version, payload).map(Self::WINCH_STATUS)
34099 }
34100 WIND_COV_DATA::ID => WIND_COV_DATA::deser(version, payload).map(Self::WIND_COV),
34101 _ => Err(::mavlink_core::error::ParserError::UnknownMessage { id }),
34102 }
34103 }
34104 fn message_name(&self) -> &'static str {
34105 match self {
34106 Self::ACTUATOR_CONTROL_TARGET(..) => ACTUATOR_CONTROL_TARGET_DATA::NAME,
34107 Self::ACTUATOR_OUTPUT_STATUS(..) => ACTUATOR_OUTPUT_STATUS_DATA::NAME,
34108 Self::ADSB_VEHICLE(..) => ADSB_VEHICLE_DATA::NAME,
34109 Self::AIS_VESSEL(..) => AIS_VESSEL_DATA::NAME,
34110 Self::ALTITUDE(..) => ALTITUDE_DATA::NAME,
34111 Self::ATTITUDE(..) => ATTITUDE_DATA::NAME,
34112 Self::ATTITUDE_QUATERNION(..) => ATTITUDE_QUATERNION_DATA::NAME,
34113 Self::ATTITUDE_QUATERNION_COV(..) => ATTITUDE_QUATERNION_COV_DATA::NAME,
34114 Self::ATTITUDE_TARGET(..) => ATTITUDE_TARGET_DATA::NAME,
34115 Self::ATT_POS_MOCAP(..) => ATT_POS_MOCAP_DATA::NAME,
34116 Self::AUTH_KEY(..) => AUTH_KEY_DATA::NAME,
34117 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(..) => {
34118 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::NAME
34119 }
34120 Self::AUTOPILOT_VERSION(..) => AUTOPILOT_VERSION_DATA::NAME,
34121 Self::AVAILABLE_MODES(..) => AVAILABLE_MODES_DATA::NAME,
34122 Self::AVAILABLE_MODES_MONITOR(..) => AVAILABLE_MODES_MONITOR_DATA::NAME,
34123 Self::BATTERY_INFO(..) => BATTERY_INFO_DATA::NAME,
34124 Self::BATTERY_STATUS(..) => BATTERY_STATUS_DATA::NAME,
34125 Self::BUTTON_CHANGE(..) => BUTTON_CHANGE_DATA::NAME,
34126 Self::CAMERA_CAPTURE_STATUS(..) => CAMERA_CAPTURE_STATUS_DATA::NAME,
34127 Self::CAMERA_FOV_STATUS(..) => CAMERA_FOV_STATUS_DATA::NAME,
34128 Self::CAMERA_IMAGE_CAPTURED(..) => CAMERA_IMAGE_CAPTURED_DATA::NAME,
34129 Self::CAMERA_INFORMATION(..) => CAMERA_INFORMATION_DATA::NAME,
34130 Self::CAMERA_SETTINGS(..) => CAMERA_SETTINGS_DATA::NAME,
34131 Self::CAMERA_THERMAL_RANGE(..) => CAMERA_THERMAL_RANGE_DATA::NAME,
34132 Self::CAMERA_TRACKING_GEO_STATUS(..) => CAMERA_TRACKING_GEO_STATUS_DATA::NAME,
34133 Self::CAMERA_TRACKING_IMAGE_STATUS(..) => CAMERA_TRACKING_IMAGE_STATUS_DATA::NAME,
34134 Self::CAMERA_TRIGGER(..) => CAMERA_TRIGGER_DATA::NAME,
34135 Self::CANFD_FRAME(..) => CANFD_FRAME_DATA::NAME,
34136 Self::CAN_FILTER_MODIFY(..) => CAN_FILTER_MODIFY_DATA::NAME,
34137 Self::CAN_FRAME(..) => CAN_FRAME_DATA::NAME,
34138 Self::CELLULAR_CONFIG(..) => CELLULAR_CONFIG_DATA::NAME,
34139 Self::CELLULAR_STATUS(..) => CELLULAR_STATUS_DATA::NAME,
34140 Self::CHANGE_OPERATOR_CONTROL(..) => CHANGE_OPERATOR_CONTROL_DATA::NAME,
34141 Self::CHANGE_OPERATOR_CONTROL_ACK(..) => CHANGE_OPERATOR_CONTROL_ACK_DATA::NAME,
34142 Self::COLLISION(..) => COLLISION_DATA::NAME,
34143 Self::COMMAND_ACK(..) => COMMAND_ACK_DATA::NAME,
34144 Self::COMMAND_CANCEL(..) => COMMAND_CANCEL_DATA::NAME,
34145 Self::COMMAND_INT(..) => COMMAND_INT_DATA::NAME,
34146 Self::COMMAND_LONG(..) => COMMAND_LONG_DATA::NAME,
34147 Self::COMPONENT_INFORMATION(..) => COMPONENT_INFORMATION_DATA::NAME,
34148 Self::COMPONENT_INFORMATION_BASIC(..) => COMPONENT_INFORMATION_BASIC_DATA::NAME,
34149 Self::COMPONENT_METADATA(..) => COMPONENT_METADATA_DATA::NAME,
34150 Self::CONTROL_SYSTEM_STATE(..) => CONTROL_SYSTEM_STATE_DATA::NAME,
34151 Self::CURRENT_EVENT_SEQUENCE(..) => CURRENT_EVENT_SEQUENCE_DATA::NAME,
34152 Self::CURRENT_MODE(..) => CURRENT_MODE_DATA::NAME,
34153 Self::DATA_STREAM(..) => DATA_STREAM_DATA::NAME,
34154 Self::DATA_TRANSMISSION_HANDSHAKE(..) => DATA_TRANSMISSION_HANDSHAKE_DATA::NAME,
34155 Self::DEBUG(..) => DEBUG_DATA::NAME,
34156 Self::DEBUG_FLOAT_ARRAY(..) => DEBUG_FLOAT_ARRAY_DATA::NAME,
34157 Self::DEBUG_VECT(..) => DEBUG_VECT_DATA::NAME,
34158 Self::DISTANCE_SENSOR(..) => DISTANCE_SENSOR_DATA::NAME,
34159 Self::EFI_STATUS(..) => EFI_STATUS_DATA::NAME,
34160 Self::ENCAPSULATED_DATA(..) => ENCAPSULATED_DATA_DATA::NAME,
34161 Self::ESC_INFO(..) => ESC_INFO_DATA::NAME,
34162 Self::ESC_STATUS(..) => ESC_STATUS_DATA::NAME,
34163 Self::ESTIMATOR_STATUS(..) => ESTIMATOR_STATUS_DATA::NAME,
34164 Self::EVENT(..) => EVENT_DATA::NAME,
34165 Self::EXTENDED_SYS_STATE(..) => EXTENDED_SYS_STATE_DATA::NAME,
34166 Self::FENCE_STATUS(..) => FENCE_STATUS_DATA::NAME,
34167 Self::FILE_TRANSFER_PROTOCOL(..) => FILE_TRANSFER_PROTOCOL_DATA::NAME,
34168 Self::FLIGHT_INFORMATION(..) => FLIGHT_INFORMATION_DATA::NAME,
34169 Self::FOLLOW_TARGET(..) => FOLLOW_TARGET_DATA::NAME,
34170 Self::FUEL_STATUS(..) => FUEL_STATUS_DATA::NAME,
34171 Self::GENERATOR_STATUS(..) => GENERATOR_STATUS_DATA::NAME,
34172 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(..) => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::NAME,
34173 Self::GIMBAL_DEVICE_INFORMATION(..) => GIMBAL_DEVICE_INFORMATION_DATA::NAME,
34174 Self::GIMBAL_DEVICE_SET_ATTITUDE(..) => GIMBAL_DEVICE_SET_ATTITUDE_DATA::NAME,
34175 Self::GIMBAL_MANAGER_INFORMATION(..) => GIMBAL_MANAGER_INFORMATION_DATA::NAME,
34176 Self::GIMBAL_MANAGER_SET_ATTITUDE(..) => GIMBAL_MANAGER_SET_ATTITUDE_DATA::NAME,
34177 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(..) => {
34178 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::NAME
34179 }
34180 Self::GIMBAL_MANAGER_SET_PITCHYAW(..) => GIMBAL_MANAGER_SET_PITCHYAW_DATA::NAME,
34181 Self::GIMBAL_MANAGER_STATUS(..) => GIMBAL_MANAGER_STATUS_DATA::NAME,
34182 Self::GLOBAL_POSITION_INT(..) => GLOBAL_POSITION_INT_DATA::NAME,
34183 Self::GLOBAL_POSITION_INT_COV(..) => GLOBAL_POSITION_INT_COV_DATA::NAME,
34184 Self::GLOBAL_VISION_POSITION_ESTIMATE(..) => GLOBAL_VISION_POSITION_ESTIMATE_DATA::NAME,
34185 Self::GPS2_RAW(..) => GPS2_RAW_DATA::NAME,
34186 Self::GPS2_RTK(..) => GPS2_RTK_DATA::NAME,
34187 Self::GPS_GLOBAL_ORIGIN(..) => GPS_GLOBAL_ORIGIN_DATA::NAME,
34188 Self::GPS_INJECT_DATA(..) => GPS_INJECT_DATA_DATA::NAME,
34189 Self::GPS_INPUT(..) => GPS_INPUT_DATA::NAME,
34190 Self::GPS_RAW_INT(..) => GPS_RAW_INT_DATA::NAME,
34191 Self::GPS_RTCM_DATA(..) => GPS_RTCM_DATA_DATA::NAME,
34192 Self::GPS_RTK(..) => GPS_RTK_DATA::NAME,
34193 Self::GPS_STATUS(..) => GPS_STATUS_DATA::NAME,
34194 Self::HEARTBEAT(..) => HEARTBEAT_DATA::NAME,
34195 Self::HIGHRES_IMU(..) => HIGHRES_IMU_DATA::NAME,
34196 Self::HIGH_LATENCY(..) => HIGH_LATENCY_DATA::NAME,
34197 Self::HIGH_LATENCY2(..) => HIGH_LATENCY2_DATA::NAME,
34198 Self::HIL_ACTUATOR_CONTROLS(..) => HIL_ACTUATOR_CONTROLS_DATA::NAME,
34199 Self::HIL_CONTROLS(..) => HIL_CONTROLS_DATA::NAME,
34200 Self::HIL_GPS(..) => HIL_GPS_DATA::NAME,
34201 Self::HIL_OPTICAL_FLOW(..) => HIL_OPTICAL_FLOW_DATA::NAME,
34202 Self::HIL_RC_INPUTS_RAW(..) => HIL_RC_INPUTS_RAW_DATA::NAME,
34203 Self::HIL_SENSOR(..) => HIL_SENSOR_DATA::NAME,
34204 Self::HIL_STATE(..) => HIL_STATE_DATA::NAME,
34205 Self::HIL_STATE_QUATERNION(..) => HIL_STATE_QUATERNION_DATA::NAME,
34206 Self::HOME_POSITION(..) => HOME_POSITION_DATA::NAME,
34207 Self::HYGROMETER_SENSOR(..) => HYGROMETER_SENSOR_DATA::NAME,
34208 Self::ILLUMINATOR_STATUS(..) => ILLUMINATOR_STATUS_DATA::NAME,
34209 Self::ISBD_LINK_STATUS(..) => ISBD_LINK_STATUS_DATA::NAME,
34210 Self::LANDING_TARGET(..) => LANDING_TARGET_DATA::NAME,
34211 Self::LINK_NODE_STATUS(..) => LINK_NODE_STATUS_DATA::NAME,
34212 Self::LOCAL_POSITION_NED(..) => LOCAL_POSITION_NED_DATA::NAME,
34213 Self::LOCAL_POSITION_NED_COV(..) => LOCAL_POSITION_NED_COV_DATA::NAME,
34214 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(..) => {
34215 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::NAME
34216 }
34217 Self::LOGGING_ACK(..) => LOGGING_ACK_DATA::NAME,
34218 Self::LOGGING_DATA(..) => LOGGING_DATA_DATA::NAME,
34219 Self::LOGGING_DATA_ACKED(..) => LOGGING_DATA_ACKED_DATA::NAME,
34220 Self::LOG_DATA(..) => LOG_DATA_DATA::NAME,
34221 Self::LOG_ENTRY(..) => LOG_ENTRY_DATA::NAME,
34222 Self::LOG_ERASE(..) => LOG_ERASE_DATA::NAME,
34223 Self::LOG_REQUEST_DATA(..) => LOG_REQUEST_DATA_DATA::NAME,
34224 Self::LOG_REQUEST_END(..) => LOG_REQUEST_END_DATA::NAME,
34225 Self::LOG_REQUEST_LIST(..) => LOG_REQUEST_LIST_DATA::NAME,
34226 Self::MAG_CAL_REPORT(..) => MAG_CAL_REPORT_DATA::NAME,
34227 Self::MANUAL_CONTROL(..) => MANUAL_CONTROL_DATA::NAME,
34228 Self::MANUAL_SETPOINT(..) => MANUAL_SETPOINT_DATA::NAME,
34229 Self::MEMORY_VECT(..) => MEMORY_VECT_DATA::NAME,
34230 Self::MESSAGE_INTERVAL(..) => MESSAGE_INTERVAL_DATA::NAME,
34231 Self::MISSION_ACK(..) => MISSION_ACK_DATA::NAME,
34232 Self::MISSION_CLEAR_ALL(..) => MISSION_CLEAR_ALL_DATA::NAME,
34233 Self::MISSION_COUNT(..) => MISSION_COUNT_DATA::NAME,
34234 Self::MISSION_CURRENT(..) => MISSION_CURRENT_DATA::NAME,
34235 Self::MISSION_ITEM(..) => MISSION_ITEM_DATA::NAME,
34236 Self::MISSION_ITEM_INT(..) => MISSION_ITEM_INT_DATA::NAME,
34237 Self::MISSION_ITEM_REACHED(..) => MISSION_ITEM_REACHED_DATA::NAME,
34238 Self::MISSION_REQUEST(..) => MISSION_REQUEST_DATA::NAME,
34239 Self::MISSION_REQUEST_INT(..) => MISSION_REQUEST_INT_DATA::NAME,
34240 Self::MISSION_REQUEST_LIST(..) => MISSION_REQUEST_LIST_DATA::NAME,
34241 Self::MISSION_REQUEST_PARTIAL_LIST(..) => MISSION_REQUEST_PARTIAL_LIST_DATA::NAME,
34242 Self::MISSION_SET_CURRENT(..) => MISSION_SET_CURRENT_DATA::NAME,
34243 Self::MISSION_WRITE_PARTIAL_LIST(..) => MISSION_WRITE_PARTIAL_LIST_DATA::NAME,
34244 Self::MOUNT_ORIENTATION(..) => MOUNT_ORIENTATION_DATA::NAME,
34245 Self::NAMED_VALUE_FLOAT(..) => NAMED_VALUE_FLOAT_DATA::NAME,
34246 Self::NAMED_VALUE_INT(..) => NAMED_VALUE_INT_DATA::NAME,
34247 Self::NAV_CONTROLLER_OUTPUT(..) => NAV_CONTROLLER_OUTPUT_DATA::NAME,
34248 Self::NAV_FILTER_BIAS(..) => NAV_FILTER_BIAS_DATA::NAME,
34249 Self::OBSTACLE_DISTANCE(..) => OBSTACLE_DISTANCE_DATA::NAME,
34250 Self::ODOMETRY(..) => ODOMETRY_DATA::NAME,
34251 Self::ONBOARD_COMPUTER_STATUS(..) => ONBOARD_COMPUTER_STATUS_DATA::NAME,
34252 Self::OPEN_DRONE_ID_ARM_STATUS(..) => OPEN_DRONE_ID_ARM_STATUS_DATA::NAME,
34253 Self::OPEN_DRONE_ID_AUTHENTICATION(..) => OPEN_DRONE_ID_AUTHENTICATION_DATA::NAME,
34254 Self::OPEN_DRONE_ID_BASIC_ID(..) => OPEN_DRONE_ID_BASIC_ID_DATA::NAME,
34255 Self::OPEN_DRONE_ID_LOCATION(..) => OPEN_DRONE_ID_LOCATION_DATA::NAME,
34256 Self::OPEN_DRONE_ID_MESSAGE_PACK(..) => OPEN_DRONE_ID_MESSAGE_PACK_DATA::NAME,
34257 Self::OPEN_DRONE_ID_OPERATOR_ID(..) => OPEN_DRONE_ID_OPERATOR_ID_DATA::NAME,
34258 Self::OPEN_DRONE_ID_SELF_ID(..) => OPEN_DRONE_ID_SELF_ID_DATA::NAME,
34259 Self::OPEN_DRONE_ID_SYSTEM(..) => OPEN_DRONE_ID_SYSTEM_DATA::NAME,
34260 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(..) => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::NAME,
34261 Self::OPTICAL_FLOW(..) => OPTICAL_FLOW_DATA::NAME,
34262 Self::OPTICAL_FLOW_RAD(..) => OPTICAL_FLOW_RAD_DATA::NAME,
34263 Self::ORBIT_EXECUTION_STATUS(..) => ORBIT_EXECUTION_STATUS_DATA::NAME,
34264 Self::PARAM_EXT_ACK(..) => PARAM_EXT_ACK_DATA::NAME,
34265 Self::PARAM_EXT_REQUEST_LIST(..) => PARAM_EXT_REQUEST_LIST_DATA::NAME,
34266 Self::PARAM_EXT_REQUEST_READ(..) => PARAM_EXT_REQUEST_READ_DATA::NAME,
34267 Self::PARAM_EXT_SET(..) => PARAM_EXT_SET_DATA::NAME,
34268 Self::PARAM_EXT_VALUE(..) => PARAM_EXT_VALUE_DATA::NAME,
34269 Self::PARAM_MAP_RC(..) => PARAM_MAP_RC_DATA::NAME,
34270 Self::PARAM_REQUEST_LIST(..) => PARAM_REQUEST_LIST_DATA::NAME,
34271 Self::PARAM_REQUEST_READ(..) => PARAM_REQUEST_READ_DATA::NAME,
34272 Self::PARAM_SET(..) => PARAM_SET_DATA::NAME,
34273 Self::PARAM_VALUE(..) => PARAM_VALUE_DATA::NAME,
34274 Self::PING(..) => PING_DATA::NAME,
34275 Self::PLAY_TUNE(..) => PLAY_TUNE_DATA::NAME,
34276 Self::PLAY_TUNE_V2(..) => PLAY_TUNE_V2_DATA::NAME,
34277 Self::POSITION_TARGET_GLOBAL_INT(..) => POSITION_TARGET_GLOBAL_INT_DATA::NAME,
34278 Self::POSITION_TARGET_LOCAL_NED(..) => POSITION_TARGET_LOCAL_NED_DATA::NAME,
34279 Self::POWER_STATUS(..) => POWER_STATUS_DATA::NAME,
34280 Self::PROTOCOL_VERSION(..) => PROTOCOL_VERSION_DATA::NAME,
34281 Self::RADIO_CALIBRATION(..) => RADIO_CALIBRATION_DATA::NAME,
34282 Self::RADIO_STATUS(..) => RADIO_STATUS_DATA::NAME,
34283 Self::RAW_IMU(..) => RAW_IMU_DATA::NAME,
34284 Self::RAW_PRESSURE(..) => RAW_PRESSURE_DATA::NAME,
34285 Self::RAW_RPM(..) => RAW_RPM_DATA::NAME,
34286 Self::RC_CHANNELS(..) => RC_CHANNELS_DATA::NAME,
34287 Self::RC_CHANNELS_OVERRIDE(..) => RC_CHANNELS_OVERRIDE_DATA::NAME,
34288 Self::RC_CHANNELS_RAW(..) => RC_CHANNELS_RAW_DATA::NAME,
34289 Self::RC_CHANNELS_SCALED(..) => RC_CHANNELS_SCALED_DATA::NAME,
34290 Self::REQUEST_DATA_STREAM(..) => REQUEST_DATA_STREAM_DATA::NAME,
34291 Self::REQUEST_EVENT(..) => REQUEST_EVENT_DATA::NAME,
34292 Self::RESOURCE_REQUEST(..) => RESOURCE_REQUEST_DATA::NAME,
34293 Self::RESPONSE_EVENT_ERROR(..) => RESPONSE_EVENT_ERROR_DATA::NAME,
34294 Self::SAFETY_ALLOWED_AREA(..) => SAFETY_ALLOWED_AREA_DATA::NAME,
34295 Self::SAFETY_SET_ALLOWED_AREA(..) => SAFETY_SET_ALLOWED_AREA_DATA::NAME,
34296 Self::SCALED_IMU(..) => SCALED_IMU_DATA::NAME,
34297 Self::SCALED_IMU2(..) => SCALED_IMU2_DATA::NAME,
34298 Self::SCALED_IMU3(..) => SCALED_IMU3_DATA::NAME,
34299 Self::SCALED_PRESSURE(..) => SCALED_PRESSURE_DATA::NAME,
34300 Self::SCALED_PRESSURE2(..) => SCALED_PRESSURE2_DATA::NAME,
34301 Self::SCALED_PRESSURE3(..) => SCALED_PRESSURE3_DATA::NAME,
34302 Self::SERIAL_CONTROL(..) => SERIAL_CONTROL_DATA::NAME,
34303 Self::SERVO_OUTPUT_RAW(..) => SERVO_OUTPUT_RAW_DATA::NAME,
34304 Self::SETUP_SIGNING(..) => SETUP_SIGNING_DATA::NAME,
34305 Self::SET_ACTUATOR_CONTROL_TARGET(..) => SET_ACTUATOR_CONTROL_TARGET_DATA::NAME,
34306 Self::SET_ATTITUDE_TARGET(..) => SET_ATTITUDE_TARGET_DATA::NAME,
34307 Self::SET_GPS_GLOBAL_ORIGIN(..) => SET_GPS_GLOBAL_ORIGIN_DATA::NAME,
34308 Self::SET_HOME_POSITION(..) => SET_HOME_POSITION_DATA::NAME,
34309 Self::SET_MODE(..) => SET_MODE_DATA::NAME,
34310 Self::SET_POSITION_TARGET_GLOBAL_INT(..) => SET_POSITION_TARGET_GLOBAL_INT_DATA::NAME,
34311 Self::SET_POSITION_TARGET_LOCAL_NED(..) => SET_POSITION_TARGET_LOCAL_NED_DATA::NAME,
34312 Self::SIM_STATE(..) => SIM_STATE_DATA::NAME,
34313 Self::SMART_BATTERY_INFO(..) => SMART_BATTERY_INFO_DATA::NAME,
34314 Self::STATUSTEXT(..) => STATUSTEXT_DATA::NAME,
34315 Self::STORAGE_INFORMATION(..) => STORAGE_INFORMATION_DATA::NAME,
34316 Self::SUPPORTED_TUNES(..) => SUPPORTED_TUNES_DATA::NAME,
34317 Self::SYSTEM_TIME(..) => SYSTEM_TIME_DATA::NAME,
34318 Self::SYS_STATUS(..) => SYS_STATUS_DATA::NAME,
34319 Self::TERRAIN_CHECK(..) => TERRAIN_CHECK_DATA::NAME,
34320 Self::TERRAIN_DATA(..) => TERRAIN_DATA_DATA::NAME,
34321 Self::TERRAIN_REPORT(..) => TERRAIN_REPORT_DATA::NAME,
34322 Self::TERRAIN_REQUEST(..) => TERRAIN_REQUEST_DATA::NAME,
34323 Self::TIMESYNC(..) => TIMESYNC_DATA::NAME,
34324 Self::TIME_ESTIMATE_TO_TARGET(..) => TIME_ESTIMATE_TO_TARGET_DATA::NAME,
34325 Self::TRAJECTORY_REPRESENTATION_BEZIER(..) => {
34326 TRAJECTORY_REPRESENTATION_BEZIER_DATA::NAME
34327 }
34328 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(..) => {
34329 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::NAME
34330 }
34331 Self::TUNNEL(..) => TUNNEL_DATA::NAME,
34332 Self::UALBERTA_SYS_STATUS(..) => UALBERTA_SYS_STATUS_DATA::NAME,
34333 Self::UAVCAN_NODE_INFO(..) => UAVCAN_NODE_INFO_DATA::NAME,
34334 Self::UAVCAN_NODE_STATUS(..) => UAVCAN_NODE_STATUS_DATA::NAME,
34335 Self::UTM_GLOBAL_POSITION(..) => UTM_GLOBAL_POSITION_DATA::NAME,
34336 Self::V2_EXTENSION(..) => V2_EXTENSION_DATA::NAME,
34337 Self::VFR_HUD(..) => VFR_HUD_DATA::NAME,
34338 Self::VIBRATION(..) => VIBRATION_DATA::NAME,
34339 Self::VICON_POSITION_ESTIMATE(..) => VICON_POSITION_ESTIMATE_DATA::NAME,
34340 Self::VIDEO_STREAM_INFORMATION(..) => VIDEO_STREAM_INFORMATION_DATA::NAME,
34341 Self::VIDEO_STREAM_STATUS(..) => VIDEO_STREAM_STATUS_DATA::NAME,
34342 Self::VISION_POSITION_ESTIMATE(..) => VISION_POSITION_ESTIMATE_DATA::NAME,
34343 Self::VISION_SPEED_ESTIMATE(..) => VISION_SPEED_ESTIMATE_DATA::NAME,
34344 Self::WHEEL_DISTANCE(..) => WHEEL_DISTANCE_DATA::NAME,
34345 Self::WIFI_CONFIG_AP(..) => WIFI_CONFIG_AP_DATA::NAME,
34346 Self::WINCH_STATUS(..) => WINCH_STATUS_DATA::NAME,
34347 Self::WIND_COV(..) => WIND_COV_DATA::NAME,
34348 }
34349 }
34350 fn message_id(&self) -> u32 {
34351 match self {
34352 Self::ACTUATOR_CONTROL_TARGET(..) => ACTUATOR_CONTROL_TARGET_DATA::ID,
34353 Self::ACTUATOR_OUTPUT_STATUS(..) => ACTUATOR_OUTPUT_STATUS_DATA::ID,
34354 Self::ADSB_VEHICLE(..) => ADSB_VEHICLE_DATA::ID,
34355 Self::AIS_VESSEL(..) => AIS_VESSEL_DATA::ID,
34356 Self::ALTITUDE(..) => ALTITUDE_DATA::ID,
34357 Self::ATTITUDE(..) => ATTITUDE_DATA::ID,
34358 Self::ATTITUDE_QUATERNION(..) => ATTITUDE_QUATERNION_DATA::ID,
34359 Self::ATTITUDE_QUATERNION_COV(..) => ATTITUDE_QUATERNION_COV_DATA::ID,
34360 Self::ATTITUDE_TARGET(..) => ATTITUDE_TARGET_DATA::ID,
34361 Self::ATT_POS_MOCAP(..) => ATT_POS_MOCAP_DATA::ID,
34362 Self::AUTH_KEY(..) => AUTH_KEY_DATA::ID,
34363 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(..) => {
34364 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID
34365 }
34366 Self::AUTOPILOT_VERSION(..) => AUTOPILOT_VERSION_DATA::ID,
34367 Self::AVAILABLE_MODES(..) => AVAILABLE_MODES_DATA::ID,
34368 Self::AVAILABLE_MODES_MONITOR(..) => AVAILABLE_MODES_MONITOR_DATA::ID,
34369 Self::BATTERY_INFO(..) => BATTERY_INFO_DATA::ID,
34370 Self::BATTERY_STATUS(..) => BATTERY_STATUS_DATA::ID,
34371 Self::BUTTON_CHANGE(..) => BUTTON_CHANGE_DATA::ID,
34372 Self::CAMERA_CAPTURE_STATUS(..) => CAMERA_CAPTURE_STATUS_DATA::ID,
34373 Self::CAMERA_FOV_STATUS(..) => CAMERA_FOV_STATUS_DATA::ID,
34374 Self::CAMERA_IMAGE_CAPTURED(..) => CAMERA_IMAGE_CAPTURED_DATA::ID,
34375 Self::CAMERA_INFORMATION(..) => CAMERA_INFORMATION_DATA::ID,
34376 Self::CAMERA_SETTINGS(..) => CAMERA_SETTINGS_DATA::ID,
34377 Self::CAMERA_THERMAL_RANGE(..) => CAMERA_THERMAL_RANGE_DATA::ID,
34378 Self::CAMERA_TRACKING_GEO_STATUS(..) => CAMERA_TRACKING_GEO_STATUS_DATA::ID,
34379 Self::CAMERA_TRACKING_IMAGE_STATUS(..) => CAMERA_TRACKING_IMAGE_STATUS_DATA::ID,
34380 Self::CAMERA_TRIGGER(..) => CAMERA_TRIGGER_DATA::ID,
34381 Self::CANFD_FRAME(..) => CANFD_FRAME_DATA::ID,
34382 Self::CAN_FILTER_MODIFY(..) => CAN_FILTER_MODIFY_DATA::ID,
34383 Self::CAN_FRAME(..) => CAN_FRAME_DATA::ID,
34384 Self::CELLULAR_CONFIG(..) => CELLULAR_CONFIG_DATA::ID,
34385 Self::CELLULAR_STATUS(..) => CELLULAR_STATUS_DATA::ID,
34386 Self::CHANGE_OPERATOR_CONTROL(..) => CHANGE_OPERATOR_CONTROL_DATA::ID,
34387 Self::CHANGE_OPERATOR_CONTROL_ACK(..) => CHANGE_OPERATOR_CONTROL_ACK_DATA::ID,
34388 Self::COLLISION(..) => COLLISION_DATA::ID,
34389 Self::COMMAND_ACK(..) => COMMAND_ACK_DATA::ID,
34390 Self::COMMAND_CANCEL(..) => COMMAND_CANCEL_DATA::ID,
34391 Self::COMMAND_INT(..) => COMMAND_INT_DATA::ID,
34392 Self::COMMAND_LONG(..) => COMMAND_LONG_DATA::ID,
34393 Self::COMPONENT_INFORMATION(..) => COMPONENT_INFORMATION_DATA::ID,
34394 Self::COMPONENT_INFORMATION_BASIC(..) => COMPONENT_INFORMATION_BASIC_DATA::ID,
34395 Self::COMPONENT_METADATA(..) => COMPONENT_METADATA_DATA::ID,
34396 Self::CONTROL_SYSTEM_STATE(..) => CONTROL_SYSTEM_STATE_DATA::ID,
34397 Self::CURRENT_EVENT_SEQUENCE(..) => CURRENT_EVENT_SEQUENCE_DATA::ID,
34398 Self::CURRENT_MODE(..) => CURRENT_MODE_DATA::ID,
34399 Self::DATA_STREAM(..) => DATA_STREAM_DATA::ID,
34400 Self::DATA_TRANSMISSION_HANDSHAKE(..) => DATA_TRANSMISSION_HANDSHAKE_DATA::ID,
34401 Self::DEBUG(..) => DEBUG_DATA::ID,
34402 Self::DEBUG_FLOAT_ARRAY(..) => DEBUG_FLOAT_ARRAY_DATA::ID,
34403 Self::DEBUG_VECT(..) => DEBUG_VECT_DATA::ID,
34404 Self::DISTANCE_SENSOR(..) => DISTANCE_SENSOR_DATA::ID,
34405 Self::EFI_STATUS(..) => EFI_STATUS_DATA::ID,
34406 Self::ENCAPSULATED_DATA(..) => ENCAPSULATED_DATA_DATA::ID,
34407 Self::ESC_INFO(..) => ESC_INFO_DATA::ID,
34408 Self::ESC_STATUS(..) => ESC_STATUS_DATA::ID,
34409 Self::ESTIMATOR_STATUS(..) => ESTIMATOR_STATUS_DATA::ID,
34410 Self::EVENT(..) => EVENT_DATA::ID,
34411 Self::EXTENDED_SYS_STATE(..) => EXTENDED_SYS_STATE_DATA::ID,
34412 Self::FENCE_STATUS(..) => FENCE_STATUS_DATA::ID,
34413 Self::FILE_TRANSFER_PROTOCOL(..) => FILE_TRANSFER_PROTOCOL_DATA::ID,
34414 Self::FLIGHT_INFORMATION(..) => FLIGHT_INFORMATION_DATA::ID,
34415 Self::FOLLOW_TARGET(..) => FOLLOW_TARGET_DATA::ID,
34416 Self::FUEL_STATUS(..) => FUEL_STATUS_DATA::ID,
34417 Self::GENERATOR_STATUS(..) => GENERATOR_STATUS_DATA::ID,
34418 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(..) => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID,
34419 Self::GIMBAL_DEVICE_INFORMATION(..) => GIMBAL_DEVICE_INFORMATION_DATA::ID,
34420 Self::GIMBAL_DEVICE_SET_ATTITUDE(..) => GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID,
34421 Self::GIMBAL_MANAGER_INFORMATION(..) => GIMBAL_MANAGER_INFORMATION_DATA::ID,
34422 Self::GIMBAL_MANAGER_SET_ATTITUDE(..) => GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID,
34423 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(..) => {
34424 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID
34425 }
34426 Self::GIMBAL_MANAGER_SET_PITCHYAW(..) => GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID,
34427 Self::GIMBAL_MANAGER_STATUS(..) => GIMBAL_MANAGER_STATUS_DATA::ID,
34428 Self::GLOBAL_POSITION_INT(..) => GLOBAL_POSITION_INT_DATA::ID,
34429 Self::GLOBAL_POSITION_INT_COV(..) => GLOBAL_POSITION_INT_COV_DATA::ID,
34430 Self::GLOBAL_VISION_POSITION_ESTIMATE(..) => GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID,
34431 Self::GPS2_RAW(..) => GPS2_RAW_DATA::ID,
34432 Self::GPS2_RTK(..) => GPS2_RTK_DATA::ID,
34433 Self::GPS_GLOBAL_ORIGIN(..) => GPS_GLOBAL_ORIGIN_DATA::ID,
34434 Self::GPS_INJECT_DATA(..) => GPS_INJECT_DATA_DATA::ID,
34435 Self::GPS_INPUT(..) => GPS_INPUT_DATA::ID,
34436 Self::GPS_RAW_INT(..) => GPS_RAW_INT_DATA::ID,
34437 Self::GPS_RTCM_DATA(..) => GPS_RTCM_DATA_DATA::ID,
34438 Self::GPS_RTK(..) => GPS_RTK_DATA::ID,
34439 Self::GPS_STATUS(..) => GPS_STATUS_DATA::ID,
34440 Self::HEARTBEAT(..) => HEARTBEAT_DATA::ID,
34441 Self::HIGHRES_IMU(..) => HIGHRES_IMU_DATA::ID,
34442 Self::HIGH_LATENCY(..) => HIGH_LATENCY_DATA::ID,
34443 Self::HIGH_LATENCY2(..) => HIGH_LATENCY2_DATA::ID,
34444 Self::HIL_ACTUATOR_CONTROLS(..) => HIL_ACTUATOR_CONTROLS_DATA::ID,
34445 Self::HIL_CONTROLS(..) => HIL_CONTROLS_DATA::ID,
34446 Self::HIL_GPS(..) => HIL_GPS_DATA::ID,
34447 Self::HIL_OPTICAL_FLOW(..) => HIL_OPTICAL_FLOW_DATA::ID,
34448 Self::HIL_RC_INPUTS_RAW(..) => HIL_RC_INPUTS_RAW_DATA::ID,
34449 Self::HIL_SENSOR(..) => HIL_SENSOR_DATA::ID,
34450 Self::HIL_STATE(..) => HIL_STATE_DATA::ID,
34451 Self::HIL_STATE_QUATERNION(..) => HIL_STATE_QUATERNION_DATA::ID,
34452 Self::HOME_POSITION(..) => HOME_POSITION_DATA::ID,
34453 Self::HYGROMETER_SENSOR(..) => HYGROMETER_SENSOR_DATA::ID,
34454 Self::ILLUMINATOR_STATUS(..) => ILLUMINATOR_STATUS_DATA::ID,
34455 Self::ISBD_LINK_STATUS(..) => ISBD_LINK_STATUS_DATA::ID,
34456 Self::LANDING_TARGET(..) => LANDING_TARGET_DATA::ID,
34457 Self::LINK_NODE_STATUS(..) => LINK_NODE_STATUS_DATA::ID,
34458 Self::LOCAL_POSITION_NED(..) => LOCAL_POSITION_NED_DATA::ID,
34459 Self::LOCAL_POSITION_NED_COV(..) => LOCAL_POSITION_NED_COV_DATA::ID,
34460 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(..) => {
34461 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID
34462 }
34463 Self::LOGGING_ACK(..) => LOGGING_ACK_DATA::ID,
34464 Self::LOGGING_DATA(..) => LOGGING_DATA_DATA::ID,
34465 Self::LOGGING_DATA_ACKED(..) => LOGGING_DATA_ACKED_DATA::ID,
34466 Self::LOG_DATA(..) => LOG_DATA_DATA::ID,
34467 Self::LOG_ENTRY(..) => LOG_ENTRY_DATA::ID,
34468 Self::LOG_ERASE(..) => LOG_ERASE_DATA::ID,
34469 Self::LOG_REQUEST_DATA(..) => LOG_REQUEST_DATA_DATA::ID,
34470 Self::LOG_REQUEST_END(..) => LOG_REQUEST_END_DATA::ID,
34471 Self::LOG_REQUEST_LIST(..) => LOG_REQUEST_LIST_DATA::ID,
34472 Self::MAG_CAL_REPORT(..) => MAG_CAL_REPORT_DATA::ID,
34473 Self::MANUAL_CONTROL(..) => MANUAL_CONTROL_DATA::ID,
34474 Self::MANUAL_SETPOINT(..) => MANUAL_SETPOINT_DATA::ID,
34475 Self::MEMORY_VECT(..) => MEMORY_VECT_DATA::ID,
34476 Self::MESSAGE_INTERVAL(..) => MESSAGE_INTERVAL_DATA::ID,
34477 Self::MISSION_ACK(..) => MISSION_ACK_DATA::ID,
34478 Self::MISSION_CLEAR_ALL(..) => MISSION_CLEAR_ALL_DATA::ID,
34479 Self::MISSION_COUNT(..) => MISSION_COUNT_DATA::ID,
34480 Self::MISSION_CURRENT(..) => MISSION_CURRENT_DATA::ID,
34481 Self::MISSION_ITEM(..) => MISSION_ITEM_DATA::ID,
34482 Self::MISSION_ITEM_INT(..) => MISSION_ITEM_INT_DATA::ID,
34483 Self::MISSION_ITEM_REACHED(..) => MISSION_ITEM_REACHED_DATA::ID,
34484 Self::MISSION_REQUEST(..) => MISSION_REQUEST_DATA::ID,
34485 Self::MISSION_REQUEST_INT(..) => MISSION_REQUEST_INT_DATA::ID,
34486 Self::MISSION_REQUEST_LIST(..) => MISSION_REQUEST_LIST_DATA::ID,
34487 Self::MISSION_REQUEST_PARTIAL_LIST(..) => MISSION_REQUEST_PARTIAL_LIST_DATA::ID,
34488 Self::MISSION_SET_CURRENT(..) => MISSION_SET_CURRENT_DATA::ID,
34489 Self::MISSION_WRITE_PARTIAL_LIST(..) => MISSION_WRITE_PARTIAL_LIST_DATA::ID,
34490 Self::MOUNT_ORIENTATION(..) => MOUNT_ORIENTATION_DATA::ID,
34491 Self::NAMED_VALUE_FLOAT(..) => NAMED_VALUE_FLOAT_DATA::ID,
34492 Self::NAMED_VALUE_INT(..) => NAMED_VALUE_INT_DATA::ID,
34493 Self::NAV_CONTROLLER_OUTPUT(..) => NAV_CONTROLLER_OUTPUT_DATA::ID,
34494 Self::NAV_FILTER_BIAS(..) => NAV_FILTER_BIAS_DATA::ID,
34495 Self::OBSTACLE_DISTANCE(..) => OBSTACLE_DISTANCE_DATA::ID,
34496 Self::ODOMETRY(..) => ODOMETRY_DATA::ID,
34497 Self::ONBOARD_COMPUTER_STATUS(..) => ONBOARD_COMPUTER_STATUS_DATA::ID,
34498 Self::OPEN_DRONE_ID_ARM_STATUS(..) => OPEN_DRONE_ID_ARM_STATUS_DATA::ID,
34499 Self::OPEN_DRONE_ID_AUTHENTICATION(..) => OPEN_DRONE_ID_AUTHENTICATION_DATA::ID,
34500 Self::OPEN_DRONE_ID_BASIC_ID(..) => OPEN_DRONE_ID_BASIC_ID_DATA::ID,
34501 Self::OPEN_DRONE_ID_LOCATION(..) => OPEN_DRONE_ID_LOCATION_DATA::ID,
34502 Self::OPEN_DRONE_ID_MESSAGE_PACK(..) => OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID,
34503 Self::OPEN_DRONE_ID_OPERATOR_ID(..) => OPEN_DRONE_ID_OPERATOR_ID_DATA::ID,
34504 Self::OPEN_DRONE_ID_SELF_ID(..) => OPEN_DRONE_ID_SELF_ID_DATA::ID,
34505 Self::OPEN_DRONE_ID_SYSTEM(..) => OPEN_DRONE_ID_SYSTEM_DATA::ID,
34506 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(..) => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID,
34507 Self::OPTICAL_FLOW(..) => OPTICAL_FLOW_DATA::ID,
34508 Self::OPTICAL_FLOW_RAD(..) => OPTICAL_FLOW_RAD_DATA::ID,
34509 Self::ORBIT_EXECUTION_STATUS(..) => ORBIT_EXECUTION_STATUS_DATA::ID,
34510 Self::PARAM_EXT_ACK(..) => PARAM_EXT_ACK_DATA::ID,
34511 Self::PARAM_EXT_REQUEST_LIST(..) => PARAM_EXT_REQUEST_LIST_DATA::ID,
34512 Self::PARAM_EXT_REQUEST_READ(..) => PARAM_EXT_REQUEST_READ_DATA::ID,
34513 Self::PARAM_EXT_SET(..) => PARAM_EXT_SET_DATA::ID,
34514 Self::PARAM_EXT_VALUE(..) => PARAM_EXT_VALUE_DATA::ID,
34515 Self::PARAM_MAP_RC(..) => PARAM_MAP_RC_DATA::ID,
34516 Self::PARAM_REQUEST_LIST(..) => PARAM_REQUEST_LIST_DATA::ID,
34517 Self::PARAM_REQUEST_READ(..) => PARAM_REQUEST_READ_DATA::ID,
34518 Self::PARAM_SET(..) => PARAM_SET_DATA::ID,
34519 Self::PARAM_VALUE(..) => PARAM_VALUE_DATA::ID,
34520 Self::PING(..) => PING_DATA::ID,
34521 Self::PLAY_TUNE(..) => PLAY_TUNE_DATA::ID,
34522 Self::PLAY_TUNE_V2(..) => PLAY_TUNE_V2_DATA::ID,
34523 Self::POSITION_TARGET_GLOBAL_INT(..) => POSITION_TARGET_GLOBAL_INT_DATA::ID,
34524 Self::POSITION_TARGET_LOCAL_NED(..) => POSITION_TARGET_LOCAL_NED_DATA::ID,
34525 Self::POWER_STATUS(..) => POWER_STATUS_DATA::ID,
34526 Self::PROTOCOL_VERSION(..) => PROTOCOL_VERSION_DATA::ID,
34527 Self::RADIO_CALIBRATION(..) => RADIO_CALIBRATION_DATA::ID,
34528 Self::RADIO_STATUS(..) => RADIO_STATUS_DATA::ID,
34529 Self::RAW_IMU(..) => RAW_IMU_DATA::ID,
34530 Self::RAW_PRESSURE(..) => RAW_PRESSURE_DATA::ID,
34531 Self::RAW_RPM(..) => RAW_RPM_DATA::ID,
34532 Self::RC_CHANNELS(..) => RC_CHANNELS_DATA::ID,
34533 Self::RC_CHANNELS_OVERRIDE(..) => RC_CHANNELS_OVERRIDE_DATA::ID,
34534 Self::RC_CHANNELS_RAW(..) => RC_CHANNELS_RAW_DATA::ID,
34535 Self::RC_CHANNELS_SCALED(..) => RC_CHANNELS_SCALED_DATA::ID,
34536 Self::REQUEST_DATA_STREAM(..) => REQUEST_DATA_STREAM_DATA::ID,
34537 Self::REQUEST_EVENT(..) => REQUEST_EVENT_DATA::ID,
34538 Self::RESOURCE_REQUEST(..) => RESOURCE_REQUEST_DATA::ID,
34539 Self::RESPONSE_EVENT_ERROR(..) => RESPONSE_EVENT_ERROR_DATA::ID,
34540 Self::SAFETY_ALLOWED_AREA(..) => SAFETY_ALLOWED_AREA_DATA::ID,
34541 Self::SAFETY_SET_ALLOWED_AREA(..) => SAFETY_SET_ALLOWED_AREA_DATA::ID,
34542 Self::SCALED_IMU(..) => SCALED_IMU_DATA::ID,
34543 Self::SCALED_IMU2(..) => SCALED_IMU2_DATA::ID,
34544 Self::SCALED_IMU3(..) => SCALED_IMU3_DATA::ID,
34545 Self::SCALED_PRESSURE(..) => SCALED_PRESSURE_DATA::ID,
34546 Self::SCALED_PRESSURE2(..) => SCALED_PRESSURE2_DATA::ID,
34547 Self::SCALED_PRESSURE3(..) => SCALED_PRESSURE3_DATA::ID,
34548 Self::SERIAL_CONTROL(..) => SERIAL_CONTROL_DATA::ID,
34549 Self::SERVO_OUTPUT_RAW(..) => SERVO_OUTPUT_RAW_DATA::ID,
34550 Self::SETUP_SIGNING(..) => SETUP_SIGNING_DATA::ID,
34551 Self::SET_ACTUATOR_CONTROL_TARGET(..) => SET_ACTUATOR_CONTROL_TARGET_DATA::ID,
34552 Self::SET_ATTITUDE_TARGET(..) => SET_ATTITUDE_TARGET_DATA::ID,
34553 Self::SET_GPS_GLOBAL_ORIGIN(..) => SET_GPS_GLOBAL_ORIGIN_DATA::ID,
34554 Self::SET_HOME_POSITION(..) => SET_HOME_POSITION_DATA::ID,
34555 Self::SET_MODE(..) => SET_MODE_DATA::ID,
34556 Self::SET_POSITION_TARGET_GLOBAL_INT(..) => SET_POSITION_TARGET_GLOBAL_INT_DATA::ID,
34557 Self::SET_POSITION_TARGET_LOCAL_NED(..) => SET_POSITION_TARGET_LOCAL_NED_DATA::ID,
34558 Self::SIM_STATE(..) => SIM_STATE_DATA::ID,
34559 Self::SMART_BATTERY_INFO(..) => SMART_BATTERY_INFO_DATA::ID,
34560 Self::STATUSTEXT(..) => STATUSTEXT_DATA::ID,
34561 Self::STORAGE_INFORMATION(..) => STORAGE_INFORMATION_DATA::ID,
34562 Self::SUPPORTED_TUNES(..) => SUPPORTED_TUNES_DATA::ID,
34563 Self::SYSTEM_TIME(..) => SYSTEM_TIME_DATA::ID,
34564 Self::SYS_STATUS(..) => SYS_STATUS_DATA::ID,
34565 Self::TERRAIN_CHECK(..) => TERRAIN_CHECK_DATA::ID,
34566 Self::TERRAIN_DATA(..) => TERRAIN_DATA_DATA::ID,
34567 Self::TERRAIN_REPORT(..) => TERRAIN_REPORT_DATA::ID,
34568 Self::TERRAIN_REQUEST(..) => TERRAIN_REQUEST_DATA::ID,
34569 Self::TIMESYNC(..) => TIMESYNC_DATA::ID,
34570 Self::TIME_ESTIMATE_TO_TARGET(..) => TIME_ESTIMATE_TO_TARGET_DATA::ID,
34571 Self::TRAJECTORY_REPRESENTATION_BEZIER(..) => TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID,
34572 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(..) => {
34573 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID
34574 }
34575 Self::TUNNEL(..) => TUNNEL_DATA::ID,
34576 Self::UALBERTA_SYS_STATUS(..) => UALBERTA_SYS_STATUS_DATA::ID,
34577 Self::UAVCAN_NODE_INFO(..) => UAVCAN_NODE_INFO_DATA::ID,
34578 Self::UAVCAN_NODE_STATUS(..) => UAVCAN_NODE_STATUS_DATA::ID,
34579 Self::UTM_GLOBAL_POSITION(..) => UTM_GLOBAL_POSITION_DATA::ID,
34580 Self::V2_EXTENSION(..) => V2_EXTENSION_DATA::ID,
34581 Self::VFR_HUD(..) => VFR_HUD_DATA::ID,
34582 Self::VIBRATION(..) => VIBRATION_DATA::ID,
34583 Self::VICON_POSITION_ESTIMATE(..) => VICON_POSITION_ESTIMATE_DATA::ID,
34584 Self::VIDEO_STREAM_INFORMATION(..) => VIDEO_STREAM_INFORMATION_DATA::ID,
34585 Self::VIDEO_STREAM_STATUS(..) => VIDEO_STREAM_STATUS_DATA::ID,
34586 Self::VISION_POSITION_ESTIMATE(..) => VISION_POSITION_ESTIMATE_DATA::ID,
34587 Self::VISION_SPEED_ESTIMATE(..) => VISION_SPEED_ESTIMATE_DATA::ID,
34588 Self::WHEEL_DISTANCE(..) => WHEEL_DISTANCE_DATA::ID,
34589 Self::WIFI_CONFIG_AP(..) => WIFI_CONFIG_AP_DATA::ID,
34590 Self::WINCH_STATUS(..) => WINCH_STATUS_DATA::ID,
34591 Self::WIND_COV(..) => WIND_COV_DATA::ID,
34592 }
34593 }
34594 fn message_id_from_name(name: &str) -> Option<u32> {
34595 match name {
34596 ACTUATOR_CONTROL_TARGET_DATA::NAME => Some(ACTUATOR_CONTROL_TARGET_DATA::ID),
34597 ACTUATOR_OUTPUT_STATUS_DATA::NAME => Some(ACTUATOR_OUTPUT_STATUS_DATA::ID),
34598 ADSB_VEHICLE_DATA::NAME => Some(ADSB_VEHICLE_DATA::ID),
34599 AIS_VESSEL_DATA::NAME => Some(AIS_VESSEL_DATA::ID),
34600 ALTITUDE_DATA::NAME => Some(ALTITUDE_DATA::ID),
34601 ATTITUDE_DATA::NAME => Some(ATTITUDE_DATA::ID),
34602 ATTITUDE_QUATERNION_DATA::NAME => Some(ATTITUDE_QUATERNION_DATA::ID),
34603 ATTITUDE_QUATERNION_COV_DATA::NAME => Some(ATTITUDE_QUATERNION_COV_DATA::ID),
34604 ATTITUDE_TARGET_DATA::NAME => Some(ATTITUDE_TARGET_DATA::ID),
34605 ATT_POS_MOCAP_DATA::NAME => Some(ATT_POS_MOCAP_DATA::ID),
34606 AUTH_KEY_DATA::NAME => Some(AUTH_KEY_DATA::ID),
34607 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::NAME => {
34608 Some(AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID)
34609 }
34610 AUTOPILOT_VERSION_DATA::NAME => Some(AUTOPILOT_VERSION_DATA::ID),
34611 AVAILABLE_MODES_DATA::NAME => Some(AVAILABLE_MODES_DATA::ID),
34612 AVAILABLE_MODES_MONITOR_DATA::NAME => Some(AVAILABLE_MODES_MONITOR_DATA::ID),
34613 BATTERY_INFO_DATA::NAME => Some(BATTERY_INFO_DATA::ID),
34614 BATTERY_STATUS_DATA::NAME => Some(BATTERY_STATUS_DATA::ID),
34615 BUTTON_CHANGE_DATA::NAME => Some(BUTTON_CHANGE_DATA::ID),
34616 CAMERA_CAPTURE_STATUS_DATA::NAME => Some(CAMERA_CAPTURE_STATUS_DATA::ID),
34617 CAMERA_FOV_STATUS_DATA::NAME => Some(CAMERA_FOV_STATUS_DATA::ID),
34618 CAMERA_IMAGE_CAPTURED_DATA::NAME => Some(CAMERA_IMAGE_CAPTURED_DATA::ID),
34619 CAMERA_INFORMATION_DATA::NAME => Some(CAMERA_INFORMATION_DATA::ID),
34620 CAMERA_SETTINGS_DATA::NAME => Some(CAMERA_SETTINGS_DATA::ID),
34621 CAMERA_THERMAL_RANGE_DATA::NAME => Some(CAMERA_THERMAL_RANGE_DATA::ID),
34622 CAMERA_TRACKING_GEO_STATUS_DATA::NAME => Some(CAMERA_TRACKING_GEO_STATUS_DATA::ID),
34623 CAMERA_TRACKING_IMAGE_STATUS_DATA::NAME => Some(CAMERA_TRACKING_IMAGE_STATUS_DATA::ID),
34624 CAMERA_TRIGGER_DATA::NAME => Some(CAMERA_TRIGGER_DATA::ID),
34625 CANFD_FRAME_DATA::NAME => Some(CANFD_FRAME_DATA::ID),
34626 CAN_FILTER_MODIFY_DATA::NAME => Some(CAN_FILTER_MODIFY_DATA::ID),
34627 CAN_FRAME_DATA::NAME => Some(CAN_FRAME_DATA::ID),
34628 CELLULAR_CONFIG_DATA::NAME => Some(CELLULAR_CONFIG_DATA::ID),
34629 CELLULAR_STATUS_DATA::NAME => Some(CELLULAR_STATUS_DATA::ID),
34630 CHANGE_OPERATOR_CONTROL_DATA::NAME => Some(CHANGE_OPERATOR_CONTROL_DATA::ID),
34631 CHANGE_OPERATOR_CONTROL_ACK_DATA::NAME => Some(CHANGE_OPERATOR_CONTROL_ACK_DATA::ID),
34632 COLLISION_DATA::NAME => Some(COLLISION_DATA::ID),
34633 COMMAND_ACK_DATA::NAME => Some(COMMAND_ACK_DATA::ID),
34634 COMMAND_CANCEL_DATA::NAME => Some(COMMAND_CANCEL_DATA::ID),
34635 COMMAND_INT_DATA::NAME => Some(COMMAND_INT_DATA::ID),
34636 COMMAND_LONG_DATA::NAME => Some(COMMAND_LONG_DATA::ID),
34637 COMPONENT_INFORMATION_DATA::NAME => Some(COMPONENT_INFORMATION_DATA::ID),
34638 COMPONENT_INFORMATION_BASIC_DATA::NAME => Some(COMPONENT_INFORMATION_BASIC_DATA::ID),
34639 COMPONENT_METADATA_DATA::NAME => Some(COMPONENT_METADATA_DATA::ID),
34640 CONTROL_SYSTEM_STATE_DATA::NAME => Some(CONTROL_SYSTEM_STATE_DATA::ID),
34641 CURRENT_EVENT_SEQUENCE_DATA::NAME => Some(CURRENT_EVENT_SEQUENCE_DATA::ID),
34642 CURRENT_MODE_DATA::NAME => Some(CURRENT_MODE_DATA::ID),
34643 DATA_STREAM_DATA::NAME => Some(DATA_STREAM_DATA::ID),
34644 DATA_TRANSMISSION_HANDSHAKE_DATA::NAME => Some(DATA_TRANSMISSION_HANDSHAKE_DATA::ID),
34645 DEBUG_DATA::NAME => Some(DEBUG_DATA::ID),
34646 DEBUG_FLOAT_ARRAY_DATA::NAME => Some(DEBUG_FLOAT_ARRAY_DATA::ID),
34647 DEBUG_VECT_DATA::NAME => Some(DEBUG_VECT_DATA::ID),
34648 DISTANCE_SENSOR_DATA::NAME => Some(DISTANCE_SENSOR_DATA::ID),
34649 EFI_STATUS_DATA::NAME => Some(EFI_STATUS_DATA::ID),
34650 ENCAPSULATED_DATA_DATA::NAME => Some(ENCAPSULATED_DATA_DATA::ID),
34651 ESC_INFO_DATA::NAME => Some(ESC_INFO_DATA::ID),
34652 ESC_STATUS_DATA::NAME => Some(ESC_STATUS_DATA::ID),
34653 ESTIMATOR_STATUS_DATA::NAME => Some(ESTIMATOR_STATUS_DATA::ID),
34654 EVENT_DATA::NAME => Some(EVENT_DATA::ID),
34655 EXTENDED_SYS_STATE_DATA::NAME => Some(EXTENDED_SYS_STATE_DATA::ID),
34656 FENCE_STATUS_DATA::NAME => Some(FENCE_STATUS_DATA::ID),
34657 FILE_TRANSFER_PROTOCOL_DATA::NAME => Some(FILE_TRANSFER_PROTOCOL_DATA::ID),
34658 FLIGHT_INFORMATION_DATA::NAME => Some(FLIGHT_INFORMATION_DATA::ID),
34659 FOLLOW_TARGET_DATA::NAME => Some(FOLLOW_TARGET_DATA::ID),
34660 FUEL_STATUS_DATA::NAME => Some(FUEL_STATUS_DATA::ID),
34661 GENERATOR_STATUS_DATA::NAME => Some(GENERATOR_STATUS_DATA::ID),
34662 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::NAME => {
34663 Some(GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID)
34664 }
34665 GIMBAL_DEVICE_INFORMATION_DATA::NAME => Some(GIMBAL_DEVICE_INFORMATION_DATA::ID),
34666 GIMBAL_DEVICE_SET_ATTITUDE_DATA::NAME => Some(GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID),
34667 GIMBAL_MANAGER_INFORMATION_DATA::NAME => Some(GIMBAL_MANAGER_INFORMATION_DATA::ID),
34668 GIMBAL_MANAGER_SET_ATTITUDE_DATA::NAME => Some(GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID),
34669 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::NAME => {
34670 Some(GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID)
34671 }
34672 GIMBAL_MANAGER_SET_PITCHYAW_DATA::NAME => Some(GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID),
34673 GIMBAL_MANAGER_STATUS_DATA::NAME => Some(GIMBAL_MANAGER_STATUS_DATA::ID),
34674 GLOBAL_POSITION_INT_DATA::NAME => Some(GLOBAL_POSITION_INT_DATA::ID),
34675 GLOBAL_POSITION_INT_COV_DATA::NAME => Some(GLOBAL_POSITION_INT_COV_DATA::ID),
34676 GLOBAL_VISION_POSITION_ESTIMATE_DATA::NAME => {
34677 Some(GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID)
34678 }
34679 GPS2_RAW_DATA::NAME => Some(GPS2_RAW_DATA::ID),
34680 GPS2_RTK_DATA::NAME => Some(GPS2_RTK_DATA::ID),
34681 GPS_GLOBAL_ORIGIN_DATA::NAME => Some(GPS_GLOBAL_ORIGIN_DATA::ID),
34682 GPS_INJECT_DATA_DATA::NAME => Some(GPS_INJECT_DATA_DATA::ID),
34683 GPS_INPUT_DATA::NAME => Some(GPS_INPUT_DATA::ID),
34684 GPS_RAW_INT_DATA::NAME => Some(GPS_RAW_INT_DATA::ID),
34685 GPS_RTCM_DATA_DATA::NAME => Some(GPS_RTCM_DATA_DATA::ID),
34686 GPS_RTK_DATA::NAME => Some(GPS_RTK_DATA::ID),
34687 GPS_STATUS_DATA::NAME => Some(GPS_STATUS_DATA::ID),
34688 HEARTBEAT_DATA::NAME => Some(HEARTBEAT_DATA::ID),
34689 HIGHRES_IMU_DATA::NAME => Some(HIGHRES_IMU_DATA::ID),
34690 HIGH_LATENCY_DATA::NAME => Some(HIGH_LATENCY_DATA::ID),
34691 HIGH_LATENCY2_DATA::NAME => Some(HIGH_LATENCY2_DATA::ID),
34692 HIL_ACTUATOR_CONTROLS_DATA::NAME => Some(HIL_ACTUATOR_CONTROLS_DATA::ID),
34693 HIL_CONTROLS_DATA::NAME => Some(HIL_CONTROLS_DATA::ID),
34694 HIL_GPS_DATA::NAME => Some(HIL_GPS_DATA::ID),
34695 HIL_OPTICAL_FLOW_DATA::NAME => Some(HIL_OPTICAL_FLOW_DATA::ID),
34696 HIL_RC_INPUTS_RAW_DATA::NAME => Some(HIL_RC_INPUTS_RAW_DATA::ID),
34697 HIL_SENSOR_DATA::NAME => Some(HIL_SENSOR_DATA::ID),
34698 HIL_STATE_DATA::NAME => Some(HIL_STATE_DATA::ID),
34699 HIL_STATE_QUATERNION_DATA::NAME => Some(HIL_STATE_QUATERNION_DATA::ID),
34700 HOME_POSITION_DATA::NAME => Some(HOME_POSITION_DATA::ID),
34701 HYGROMETER_SENSOR_DATA::NAME => Some(HYGROMETER_SENSOR_DATA::ID),
34702 ILLUMINATOR_STATUS_DATA::NAME => Some(ILLUMINATOR_STATUS_DATA::ID),
34703 ISBD_LINK_STATUS_DATA::NAME => Some(ISBD_LINK_STATUS_DATA::ID),
34704 LANDING_TARGET_DATA::NAME => Some(LANDING_TARGET_DATA::ID),
34705 LINK_NODE_STATUS_DATA::NAME => Some(LINK_NODE_STATUS_DATA::ID),
34706 LOCAL_POSITION_NED_DATA::NAME => Some(LOCAL_POSITION_NED_DATA::ID),
34707 LOCAL_POSITION_NED_COV_DATA::NAME => Some(LOCAL_POSITION_NED_COV_DATA::ID),
34708 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::NAME => {
34709 Some(LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID)
34710 }
34711 LOGGING_ACK_DATA::NAME => Some(LOGGING_ACK_DATA::ID),
34712 LOGGING_DATA_DATA::NAME => Some(LOGGING_DATA_DATA::ID),
34713 LOGGING_DATA_ACKED_DATA::NAME => Some(LOGGING_DATA_ACKED_DATA::ID),
34714 LOG_DATA_DATA::NAME => Some(LOG_DATA_DATA::ID),
34715 LOG_ENTRY_DATA::NAME => Some(LOG_ENTRY_DATA::ID),
34716 LOG_ERASE_DATA::NAME => Some(LOG_ERASE_DATA::ID),
34717 LOG_REQUEST_DATA_DATA::NAME => Some(LOG_REQUEST_DATA_DATA::ID),
34718 LOG_REQUEST_END_DATA::NAME => Some(LOG_REQUEST_END_DATA::ID),
34719 LOG_REQUEST_LIST_DATA::NAME => Some(LOG_REQUEST_LIST_DATA::ID),
34720 MAG_CAL_REPORT_DATA::NAME => Some(MAG_CAL_REPORT_DATA::ID),
34721 MANUAL_CONTROL_DATA::NAME => Some(MANUAL_CONTROL_DATA::ID),
34722 MANUAL_SETPOINT_DATA::NAME => Some(MANUAL_SETPOINT_DATA::ID),
34723 MEMORY_VECT_DATA::NAME => Some(MEMORY_VECT_DATA::ID),
34724 MESSAGE_INTERVAL_DATA::NAME => Some(MESSAGE_INTERVAL_DATA::ID),
34725 MISSION_ACK_DATA::NAME => Some(MISSION_ACK_DATA::ID),
34726 MISSION_CLEAR_ALL_DATA::NAME => Some(MISSION_CLEAR_ALL_DATA::ID),
34727 MISSION_COUNT_DATA::NAME => Some(MISSION_COUNT_DATA::ID),
34728 MISSION_CURRENT_DATA::NAME => Some(MISSION_CURRENT_DATA::ID),
34729 MISSION_ITEM_DATA::NAME => Some(MISSION_ITEM_DATA::ID),
34730 MISSION_ITEM_INT_DATA::NAME => Some(MISSION_ITEM_INT_DATA::ID),
34731 MISSION_ITEM_REACHED_DATA::NAME => Some(MISSION_ITEM_REACHED_DATA::ID),
34732 MISSION_REQUEST_DATA::NAME => Some(MISSION_REQUEST_DATA::ID),
34733 MISSION_REQUEST_INT_DATA::NAME => Some(MISSION_REQUEST_INT_DATA::ID),
34734 MISSION_REQUEST_LIST_DATA::NAME => Some(MISSION_REQUEST_LIST_DATA::ID),
34735 MISSION_REQUEST_PARTIAL_LIST_DATA::NAME => Some(MISSION_REQUEST_PARTIAL_LIST_DATA::ID),
34736 MISSION_SET_CURRENT_DATA::NAME => Some(MISSION_SET_CURRENT_DATA::ID),
34737 MISSION_WRITE_PARTIAL_LIST_DATA::NAME => Some(MISSION_WRITE_PARTIAL_LIST_DATA::ID),
34738 MOUNT_ORIENTATION_DATA::NAME => Some(MOUNT_ORIENTATION_DATA::ID),
34739 NAMED_VALUE_FLOAT_DATA::NAME => Some(NAMED_VALUE_FLOAT_DATA::ID),
34740 NAMED_VALUE_INT_DATA::NAME => Some(NAMED_VALUE_INT_DATA::ID),
34741 NAV_CONTROLLER_OUTPUT_DATA::NAME => Some(NAV_CONTROLLER_OUTPUT_DATA::ID),
34742 NAV_FILTER_BIAS_DATA::NAME => Some(NAV_FILTER_BIAS_DATA::ID),
34743 OBSTACLE_DISTANCE_DATA::NAME => Some(OBSTACLE_DISTANCE_DATA::ID),
34744 ODOMETRY_DATA::NAME => Some(ODOMETRY_DATA::ID),
34745 ONBOARD_COMPUTER_STATUS_DATA::NAME => Some(ONBOARD_COMPUTER_STATUS_DATA::ID),
34746 OPEN_DRONE_ID_ARM_STATUS_DATA::NAME => Some(OPEN_DRONE_ID_ARM_STATUS_DATA::ID),
34747 OPEN_DRONE_ID_AUTHENTICATION_DATA::NAME => Some(OPEN_DRONE_ID_AUTHENTICATION_DATA::ID),
34748 OPEN_DRONE_ID_BASIC_ID_DATA::NAME => Some(OPEN_DRONE_ID_BASIC_ID_DATA::ID),
34749 OPEN_DRONE_ID_LOCATION_DATA::NAME => Some(OPEN_DRONE_ID_LOCATION_DATA::ID),
34750 OPEN_DRONE_ID_MESSAGE_PACK_DATA::NAME => Some(OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID),
34751 OPEN_DRONE_ID_OPERATOR_ID_DATA::NAME => Some(OPEN_DRONE_ID_OPERATOR_ID_DATA::ID),
34752 OPEN_DRONE_ID_SELF_ID_DATA::NAME => Some(OPEN_DRONE_ID_SELF_ID_DATA::ID),
34753 OPEN_DRONE_ID_SYSTEM_DATA::NAME => Some(OPEN_DRONE_ID_SYSTEM_DATA::ID),
34754 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::NAME => Some(OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID),
34755 OPTICAL_FLOW_DATA::NAME => Some(OPTICAL_FLOW_DATA::ID),
34756 OPTICAL_FLOW_RAD_DATA::NAME => Some(OPTICAL_FLOW_RAD_DATA::ID),
34757 ORBIT_EXECUTION_STATUS_DATA::NAME => Some(ORBIT_EXECUTION_STATUS_DATA::ID),
34758 PARAM_EXT_ACK_DATA::NAME => Some(PARAM_EXT_ACK_DATA::ID),
34759 PARAM_EXT_REQUEST_LIST_DATA::NAME => Some(PARAM_EXT_REQUEST_LIST_DATA::ID),
34760 PARAM_EXT_REQUEST_READ_DATA::NAME => Some(PARAM_EXT_REQUEST_READ_DATA::ID),
34761 PARAM_EXT_SET_DATA::NAME => Some(PARAM_EXT_SET_DATA::ID),
34762 PARAM_EXT_VALUE_DATA::NAME => Some(PARAM_EXT_VALUE_DATA::ID),
34763 PARAM_MAP_RC_DATA::NAME => Some(PARAM_MAP_RC_DATA::ID),
34764 PARAM_REQUEST_LIST_DATA::NAME => Some(PARAM_REQUEST_LIST_DATA::ID),
34765 PARAM_REQUEST_READ_DATA::NAME => Some(PARAM_REQUEST_READ_DATA::ID),
34766 PARAM_SET_DATA::NAME => Some(PARAM_SET_DATA::ID),
34767 PARAM_VALUE_DATA::NAME => Some(PARAM_VALUE_DATA::ID),
34768 PING_DATA::NAME => Some(PING_DATA::ID),
34769 PLAY_TUNE_DATA::NAME => Some(PLAY_TUNE_DATA::ID),
34770 PLAY_TUNE_V2_DATA::NAME => Some(PLAY_TUNE_V2_DATA::ID),
34771 POSITION_TARGET_GLOBAL_INT_DATA::NAME => Some(POSITION_TARGET_GLOBAL_INT_DATA::ID),
34772 POSITION_TARGET_LOCAL_NED_DATA::NAME => Some(POSITION_TARGET_LOCAL_NED_DATA::ID),
34773 POWER_STATUS_DATA::NAME => Some(POWER_STATUS_DATA::ID),
34774 PROTOCOL_VERSION_DATA::NAME => Some(PROTOCOL_VERSION_DATA::ID),
34775 RADIO_CALIBRATION_DATA::NAME => Some(RADIO_CALIBRATION_DATA::ID),
34776 RADIO_STATUS_DATA::NAME => Some(RADIO_STATUS_DATA::ID),
34777 RAW_IMU_DATA::NAME => Some(RAW_IMU_DATA::ID),
34778 RAW_PRESSURE_DATA::NAME => Some(RAW_PRESSURE_DATA::ID),
34779 RAW_RPM_DATA::NAME => Some(RAW_RPM_DATA::ID),
34780 RC_CHANNELS_DATA::NAME => Some(RC_CHANNELS_DATA::ID),
34781 RC_CHANNELS_OVERRIDE_DATA::NAME => Some(RC_CHANNELS_OVERRIDE_DATA::ID),
34782 RC_CHANNELS_RAW_DATA::NAME => Some(RC_CHANNELS_RAW_DATA::ID),
34783 RC_CHANNELS_SCALED_DATA::NAME => Some(RC_CHANNELS_SCALED_DATA::ID),
34784 REQUEST_DATA_STREAM_DATA::NAME => Some(REQUEST_DATA_STREAM_DATA::ID),
34785 REQUEST_EVENT_DATA::NAME => Some(REQUEST_EVENT_DATA::ID),
34786 RESOURCE_REQUEST_DATA::NAME => Some(RESOURCE_REQUEST_DATA::ID),
34787 RESPONSE_EVENT_ERROR_DATA::NAME => Some(RESPONSE_EVENT_ERROR_DATA::ID),
34788 SAFETY_ALLOWED_AREA_DATA::NAME => Some(SAFETY_ALLOWED_AREA_DATA::ID),
34789 SAFETY_SET_ALLOWED_AREA_DATA::NAME => Some(SAFETY_SET_ALLOWED_AREA_DATA::ID),
34790 SCALED_IMU_DATA::NAME => Some(SCALED_IMU_DATA::ID),
34791 SCALED_IMU2_DATA::NAME => Some(SCALED_IMU2_DATA::ID),
34792 SCALED_IMU3_DATA::NAME => Some(SCALED_IMU3_DATA::ID),
34793 SCALED_PRESSURE_DATA::NAME => Some(SCALED_PRESSURE_DATA::ID),
34794 SCALED_PRESSURE2_DATA::NAME => Some(SCALED_PRESSURE2_DATA::ID),
34795 SCALED_PRESSURE3_DATA::NAME => Some(SCALED_PRESSURE3_DATA::ID),
34796 SERIAL_CONTROL_DATA::NAME => Some(SERIAL_CONTROL_DATA::ID),
34797 SERVO_OUTPUT_RAW_DATA::NAME => Some(SERVO_OUTPUT_RAW_DATA::ID),
34798 SETUP_SIGNING_DATA::NAME => Some(SETUP_SIGNING_DATA::ID),
34799 SET_ACTUATOR_CONTROL_TARGET_DATA::NAME => Some(SET_ACTUATOR_CONTROL_TARGET_DATA::ID),
34800 SET_ATTITUDE_TARGET_DATA::NAME => Some(SET_ATTITUDE_TARGET_DATA::ID),
34801 SET_GPS_GLOBAL_ORIGIN_DATA::NAME => Some(SET_GPS_GLOBAL_ORIGIN_DATA::ID),
34802 SET_HOME_POSITION_DATA::NAME => Some(SET_HOME_POSITION_DATA::ID),
34803 SET_MODE_DATA::NAME => Some(SET_MODE_DATA::ID),
34804 SET_POSITION_TARGET_GLOBAL_INT_DATA::NAME => {
34805 Some(SET_POSITION_TARGET_GLOBAL_INT_DATA::ID)
34806 }
34807 SET_POSITION_TARGET_LOCAL_NED_DATA::NAME => {
34808 Some(SET_POSITION_TARGET_LOCAL_NED_DATA::ID)
34809 }
34810 SIM_STATE_DATA::NAME => Some(SIM_STATE_DATA::ID),
34811 SMART_BATTERY_INFO_DATA::NAME => Some(SMART_BATTERY_INFO_DATA::ID),
34812 STATUSTEXT_DATA::NAME => Some(STATUSTEXT_DATA::ID),
34813 STORAGE_INFORMATION_DATA::NAME => Some(STORAGE_INFORMATION_DATA::ID),
34814 SUPPORTED_TUNES_DATA::NAME => Some(SUPPORTED_TUNES_DATA::ID),
34815 SYSTEM_TIME_DATA::NAME => Some(SYSTEM_TIME_DATA::ID),
34816 SYS_STATUS_DATA::NAME => Some(SYS_STATUS_DATA::ID),
34817 TERRAIN_CHECK_DATA::NAME => Some(TERRAIN_CHECK_DATA::ID),
34818 TERRAIN_DATA_DATA::NAME => Some(TERRAIN_DATA_DATA::ID),
34819 TERRAIN_REPORT_DATA::NAME => Some(TERRAIN_REPORT_DATA::ID),
34820 TERRAIN_REQUEST_DATA::NAME => Some(TERRAIN_REQUEST_DATA::ID),
34821 TIMESYNC_DATA::NAME => Some(TIMESYNC_DATA::ID),
34822 TIME_ESTIMATE_TO_TARGET_DATA::NAME => Some(TIME_ESTIMATE_TO_TARGET_DATA::ID),
34823 TRAJECTORY_REPRESENTATION_BEZIER_DATA::NAME => {
34824 Some(TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID)
34825 }
34826 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::NAME => {
34827 Some(TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID)
34828 }
34829 TUNNEL_DATA::NAME => Some(TUNNEL_DATA::ID),
34830 UALBERTA_SYS_STATUS_DATA::NAME => Some(UALBERTA_SYS_STATUS_DATA::ID),
34831 UAVCAN_NODE_INFO_DATA::NAME => Some(UAVCAN_NODE_INFO_DATA::ID),
34832 UAVCAN_NODE_STATUS_DATA::NAME => Some(UAVCAN_NODE_STATUS_DATA::ID),
34833 UTM_GLOBAL_POSITION_DATA::NAME => Some(UTM_GLOBAL_POSITION_DATA::ID),
34834 V2_EXTENSION_DATA::NAME => Some(V2_EXTENSION_DATA::ID),
34835 VFR_HUD_DATA::NAME => Some(VFR_HUD_DATA::ID),
34836 VIBRATION_DATA::NAME => Some(VIBRATION_DATA::ID),
34837 VICON_POSITION_ESTIMATE_DATA::NAME => Some(VICON_POSITION_ESTIMATE_DATA::ID),
34838 VIDEO_STREAM_INFORMATION_DATA::NAME => Some(VIDEO_STREAM_INFORMATION_DATA::ID),
34839 VIDEO_STREAM_STATUS_DATA::NAME => Some(VIDEO_STREAM_STATUS_DATA::ID),
34840 VISION_POSITION_ESTIMATE_DATA::NAME => Some(VISION_POSITION_ESTIMATE_DATA::ID),
34841 VISION_SPEED_ESTIMATE_DATA::NAME => Some(VISION_SPEED_ESTIMATE_DATA::ID),
34842 WHEEL_DISTANCE_DATA::NAME => Some(WHEEL_DISTANCE_DATA::ID),
34843 WIFI_CONFIG_AP_DATA::NAME => Some(WIFI_CONFIG_AP_DATA::ID),
34844 WINCH_STATUS_DATA::NAME => Some(WINCH_STATUS_DATA::ID),
34845 WIND_COV_DATA::NAME => Some(WIND_COV_DATA::ID),
34846 _ => None,
34847 }
34848 }
34849 fn default_message_from_id(id: u32) -> Option<Self> {
34850 match id {
34851 ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::ACTUATOR_CONTROL_TARGET(
34852 ACTUATOR_CONTROL_TARGET_DATA::default(),
34853 )),
34854 ACTUATOR_OUTPUT_STATUS_DATA::ID => Some(Self::ACTUATOR_OUTPUT_STATUS(
34855 ACTUATOR_OUTPUT_STATUS_DATA::default(),
34856 )),
34857 ADSB_VEHICLE_DATA::ID => Some(Self::ADSB_VEHICLE(ADSB_VEHICLE_DATA::default())),
34858 AIS_VESSEL_DATA::ID => Some(Self::AIS_VESSEL(AIS_VESSEL_DATA::default())),
34859 ALTITUDE_DATA::ID => Some(Self::ALTITUDE(ALTITUDE_DATA::default())),
34860 ATTITUDE_DATA::ID => Some(Self::ATTITUDE(ATTITUDE_DATA::default())),
34861 ATTITUDE_QUATERNION_DATA::ID => Some(Self::ATTITUDE_QUATERNION(
34862 ATTITUDE_QUATERNION_DATA::default(),
34863 )),
34864 ATTITUDE_QUATERNION_COV_DATA::ID => Some(Self::ATTITUDE_QUATERNION_COV(
34865 ATTITUDE_QUATERNION_COV_DATA::default(),
34866 )),
34867 ATTITUDE_TARGET_DATA::ID => {
34868 Some(Self::ATTITUDE_TARGET(ATTITUDE_TARGET_DATA::default()))
34869 }
34870 ATT_POS_MOCAP_DATA::ID => Some(Self::ATT_POS_MOCAP(ATT_POS_MOCAP_DATA::default())),
34871 AUTH_KEY_DATA::ID => Some(Self::AUTH_KEY(AUTH_KEY_DATA::default())),
34872 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
34873 Some(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(
34874 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::default(),
34875 ))
34876 }
34877 AUTOPILOT_VERSION_DATA::ID => {
34878 Some(Self::AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA::default()))
34879 }
34880 AVAILABLE_MODES_DATA::ID => {
34881 Some(Self::AVAILABLE_MODES(AVAILABLE_MODES_DATA::default()))
34882 }
34883 AVAILABLE_MODES_MONITOR_DATA::ID => Some(Self::AVAILABLE_MODES_MONITOR(
34884 AVAILABLE_MODES_MONITOR_DATA::default(),
34885 )),
34886 BATTERY_INFO_DATA::ID => Some(Self::BATTERY_INFO(BATTERY_INFO_DATA::default())),
34887 BATTERY_STATUS_DATA::ID => Some(Self::BATTERY_STATUS(BATTERY_STATUS_DATA::default())),
34888 BUTTON_CHANGE_DATA::ID => Some(Self::BUTTON_CHANGE(BUTTON_CHANGE_DATA::default())),
34889 CAMERA_CAPTURE_STATUS_DATA::ID => Some(Self::CAMERA_CAPTURE_STATUS(
34890 CAMERA_CAPTURE_STATUS_DATA::default(),
34891 )),
34892 CAMERA_FOV_STATUS_DATA::ID => {
34893 Some(Self::CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA::default()))
34894 }
34895 CAMERA_IMAGE_CAPTURED_DATA::ID => Some(Self::CAMERA_IMAGE_CAPTURED(
34896 CAMERA_IMAGE_CAPTURED_DATA::default(),
34897 )),
34898 CAMERA_INFORMATION_DATA::ID => {
34899 Some(Self::CAMERA_INFORMATION(CAMERA_INFORMATION_DATA::default()))
34900 }
34901 CAMERA_SETTINGS_DATA::ID => {
34902 Some(Self::CAMERA_SETTINGS(CAMERA_SETTINGS_DATA::default()))
34903 }
34904 CAMERA_THERMAL_RANGE_DATA::ID => Some(Self::CAMERA_THERMAL_RANGE(
34905 CAMERA_THERMAL_RANGE_DATA::default(),
34906 )),
34907 CAMERA_TRACKING_GEO_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_GEO_STATUS(
34908 CAMERA_TRACKING_GEO_STATUS_DATA::default(),
34909 )),
34910 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_IMAGE_STATUS(
34911 CAMERA_TRACKING_IMAGE_STATUS_DATA::default(),
34912 )),
34913 CAMERA_TRIGGER_DATA::ID => Some(Self::CAMERA_TRIGGER(CAMERA_TRIGGER_DATA::default())),
34914 CANFD_FRAME_DATA::ID => Some(Self::CANFD_FRAME(CANFD_FRAME_DATA::default())),
34915 CAN_FILTER_MODIFY_DATA::ID => {
34916 Some(Self::CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA::default()))
34917 }
34918 CAN_FRAME_DATA::ID => Some(Self::CAN_FRAME(CAN_FRAME_DATA::default())),
34919 CELLULAR_CONFIG_DATA::ID => {
34920 Some(Self::CELLULAR_CONFIG(CELLULAR_CONFIG_DATA::default()))
34921 }
34922 CELLULAR_STATUS_DATA::ID => {
34923 Some(Self::CELLULAR_STATUS(CELLULAR_STATUS_DATA::default()))
34924 }
34925 CHANGE_OPERATOR_CONTROL_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL(
34926 CHANGE_OPERATOR_CONTROL_DATA::default(),
34927 )),
34928 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL_ACK(
34929 CHANGE_OPERATOR_CONTROL_ACK_DATA::default(),
34930 )),
34931 COLLISION_DATA::ID => Some(Self::COLLISION(COLLISION_DATA::default())),
34932 COMMAND_ACK_DATA::ID => Some(Self::COMMAND_ACK(COMMAND_ACK_DATA::default())),
34933 COMMAND_CANCEL_DATA::ID => Some(Self::COMMAND_CANCEL(COMMAND_CANCEL_DATA::default())),
34934 COMMAND_INT_DATA::ID => Some(Self::COMMAND_INT(COMMAND_INT_DATA::default())),
34935 COMMAND_LONG_DATA::ID => Some(Self::COMMAND_LONG(COMMAND_LONG_DATA::default())),
34936 COMPONENT_INFORMATION_DATA::ID => Some(Self::COMPONENT_INFORMATION(
34937 COMPONENT_INFORMATION_DATA::default(),
34938 )),
34939 COMPONENT_INFORMATION_BASIC_DATA::ID => Some(Self::COMPONENT_INFORMATION_BASIC(
34940 COMPONENT_INFORMATION_BASIC_DATA::default(),
34941 )),
34942 COMPONENT_METADATA_DATA::ID => {
34943 Some(Self::COMPONENT_METADATA(COMPONENT_METADATA_DATA::default()))
34944 }
34945 CONTROL_SYSTEM_STATE_DATA::ID => Some(Self::CONTROL_SYSTEM_STATE(
34946 CONTROL_SYSTEM_STATE_DATA::default(),
34947 )),
34948 CURRENT_EVENT_SEQUENCE_DATA::ID => Some(Self::CURRENT_EVENT_SEQUENCE(
34949 CURRENT_EVENT_SEQUENCE_DATA::default(),
34950 )),
34951 CURRENT_MODE_DATA::ID => Some(Self::CURRENT_MODE(CURRENT_MODE_DATA::default())),
34952 DATA_STREAM_DATA::ID => Some(Self::DATA_STREAM(DATA_STREAM_DATA::default())),
34953 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => Some(Self::DATA_TRANSMISSION_HANDSHAKE(
34954 DATA_TRANSMISSION_HANDSHAKE_DATA::default(),
34955 )),
34956 DEBUG_DATA::ID => Some(Self::DEBUG(DEBUG_DATA::default())),
34957 DEBUG_FLOAT_ARRAY_DATA::ID => {
34958 Some(Self::DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA::default()))
34959 }
34960 DEBUG_VECT_DATA::ID => Some(Self::DEBUG_VECT(DEBUG_VECT_DATA::default())),
34961 DISTANCE_SENSOR_DATA::ID => {
34962 Some(Self::DISTANCE_SENSOR(DISTANCE_SENSOR_DATA::default()))
34963 }
34964 EFI_STATUS_DATA::ID => Some(Self::EFI_STATUS(EFI_STATUS_DATA::default())),
34965 ENCAPSULATED_DATA_DATA::ID => {
34966 Some(Self::ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA::default()))
34967 }
34968 ESC_INFO_DATA::ID => Some(Self::ESC_INFO(ESC_INFO_DATA::default())),
34969 ESC_STATUS_DATA::ID => Some(Self::ESC_STATUS(ESC_STATUS_DATA::default())),
34970 ESTIMATOR_STATUS_DATA::ID => {
34971 Some(Self::ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA::default()))
34972 }
34973 EVENT_DATA::ID => Some(Self::EVENT(EVENT_DATA::default())),
34974 EXTENDED_SYS_STATE_DATA::ID => {
34975 Some(Self::EXTENDED_SYS_STATE(EXTENDED_SYS_STATE_DATA::default()))
34976 }
34977 FENCE_STATUS_DATA::ID => Some(Self::FENCE_STATUS(FENCE_STATUS_DATA::default())),
34978 FILE_TRANSFER_PROTOCOL_DATA::ID => Some(Self::FILE_TRANSFER_PROTOCOL(
34979 FILE_TRANSFER_PROTOCOL_DATA::default(),
34980 )),
34981 FLIGHT_INFORMATION_DATA::ID => {
34982 Some(Self::FLIGHT_INFORMATION(FLIGHT_INFORMATION_DATA::default()))
34983 }
34984 FOLLOW_TARGET_DATA::ID => Some(Self::FOLLOW_TARGET(FOLLOW_TARGET_DATA::default())),
34985 FUEL_STATUS_DATA::ID => Some(Self::FUEL_STATUS(FUEL_STATUS_DATA::default())),
34986 GENERATOR_STATUS_DATA::ID => {
34987 Some(Self::GENERATOR_STATUS(GENERATOR_STATUS_DATA::default()))
34988 }
34989 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => Some(Self::GIMBAL_DEVICE_ATTITUDE_STATUS(
34990 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::default(),
34991 )),
34992 GIMBAL_DEVICE_INFORMATION_DATA::ID => Some(Self::GIMBAL_DEVICE_INFORMATION(
34993 GIMBAL_DEVICE_INFORMATION_DATA::default(),
34994 )),
34995 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_DEVICE_SET_ATTITUDE(
34996 GIMBAL_DEVICE_SET_ATTITUDE_DATA::default(),
34997 )),
34998 GIMBAL_MANAGER_INFORMATION_DATA::ID => Some(Self::GIMBAL_MANAGER_INFORMATION(
34999 GIMBAL_MANAGER_INFORMATION_DATA::default(),
35000 )),
35001 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_ATTITUDE(
35002 GIMBAL_MANAGER_SET_ATTITUDE_DATA::default(),
35003 )),
35004 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
35005 Some(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(
35006 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::default(),
35007 ))
35008 }
35009 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_PITCHYAW(
35010 GIMBAL_MANAGER_SET_PITCHYAW_DATA::default(),
35011 )),
35012 GIMBAL_MANAGER_STATUS_DATA::ID => Some(Self::GIMBAL_MANAGER_STATUS(
35013 GIMBAL_MANAGER_STATUS_DATA::default(),
35014 )),
35015 GLOBAL_POSITION_INT_DATA::ID => Some(Self::GLOBAL_POSITION_INT(
35016 GLOBAL_POSITION_INT_DATA::default(),
35017 )),
35018 GLOBAL_POSITION_INT_COV_DATA::ID => Some(Self::GLOBAL_POSITION_INT_COV(
35019 GLOBAL_POSITION_INT_COV_DATA::default(),
35020 )),
35021 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
35022 Some(Self::GLOBAL_VISION_POSITION_ESTIMATE(
35023 GLOBAL_VISION_POSITION_ESTIMATE_DATA::default(),
35024 ))
35025 }
35026 GPS2_RAW_DATA::ID => Some(Self::GPS2_RAW(GPS2_RAW_DATA::default())),
35027 GPS2_RTK_DATA::ID => Some(Self::GPS2_RTK(GPS2_RTK_DATA::default())),
35028 GPS_GLOBAL_ORIGIN_DATA::ID => {
35029 Some(Self::GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA::default()))
35030 }
35031 GPS_INJECT_DATA_DATA::ID => {
35032 Some(Self::GPS_INJECT_DATA(GPS_INJECT_DATA_DATA::default()))
35033 }
35034 GPS_INPUT_DATA::ID => Some(Self::GPS_INPUT(GPS_INPUT_DATA::default())),
35035 GPS_RAW_INT_DATA::ID => Some(Self::GPS_RAW_INT(GPS_RAW_INT_DATA::default())),
35036 GPS_RTCM_DATA_DATA::ID => Some(Self::GPS_RTCM_DATA(GPS_RTCM_DATA_DATA::default())),
35037 GPS_RTK_DATA::ID => Some(Self::GPS_RTK(GPS_RTK_DATA::default())),
35038 GPS_STATUS_DATA::ID => Some(Self::GPS_STATUS(GPS_STATUS_DATA::default())),
35039 HEARTBEAT_DATA::ID => Some(Self::HEARTBEAT(HEARTBEAT_DATA::default())),
35040 HIGHRES_IMU_DATA::ID => Some(Self::HIGHRES_IMU(HIGHRES_IMU_DATA::default())),
35041 HIGH_LATENCY_DATA::ID => Some(Self::HIGH_LATENCY(HIGH_LATENCY_DATA::default())),
35042 HIGH_LATENCY2_DATA::ID => Some(Self::HIGH_LATENCY2(HIGH_LATENCY2_DATA::default())),
35043 HIL_ACTUATOR_CONTROLS_DATA::ID => Some(Self::HIL_ACTUATOR_CONTROLS(
35044 HIL_ACTUATOR_CONTROLS_DATA::default(),
35045 )),
35046 HIL_CONTROLS_DATA::ID => Some(Self::HIL_CONTROLS(HIL_CONTROLS_DATA::default())),
35047 HIL_GPS_DATA::ID => Some(Self::HIL_GPS(HIL_GPS_DATA::default())),
35048 HIL_OPTICAL_FLOW_DATA::ID => {
35049 Some(Self::HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA::default()))
35050 }
35051 HIL_RC_INPUTS_RAW_DATA::ID => {
35052 Some(Self::HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA::default()))
35053 }
35054 HIL_SENSOR_DATA::ID => Some(Self::HIL_SENSOR(HIL_SENSOR_DATA::default())),
35055 HIL_STATE_DATA::ID => Some(Self::HIL_STATE(HIL_STATE_DATA::default())),
35056 HIL_STATE_QUATERNION_DATA::ID => Some(Self::HIL_STATE_QUATERNION(
35057 HIL_STATE_QUATERNION_DATA::default(),
35058 )),
35059 HOME_POSITION_DATA::ID => Some(Self::HOME_POSITION(HOME_POSITION_DATA::default())),
35060 HYGROMETER_SENSOR_DATA::ID => {
35061 Some(Self::HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA::default()))
35062 }
35063 ILLUMINATOR_STATUS_DATA::ID => {
35064 Some(Self::ILLUMINATOR_STATUS(ILLUMINATOR_STATUS_DATA::default()))
35065 }
35066 ISBD_LINK_STATUS_DATA::ID => {
35067 Some(Self::ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA::default()))
35068 }
35069 LANDING_TARGET_DATA::ID => Some(Self::LANDING_TARGET(LANDING_TARGET_DATA::default())),
35070 LINK_NODE_STATUS_DATA::ID => {
35071 Some(Self::LINK_NODE_STATUS(LINK_NODE_STATUS_DATA::default()))
35072 }
35073 LOCAL_POSITION_NED_DATA::ID => {
35074 Some(Self::LOCAL_POSITION_NED(LOCAL_POSITION_NED_DATA::default()))
35075 }
35076 LOCAL_POSITION_NED_COV_DATA::ID => Some(Self::LOCAL_POSITION_NED_COV(
35077 LOCAL_POSITION_NED_COV_DATA::default(),
35078 )),
35079 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
35080 Some(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(
35081 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::default(),
35082 ))
35083 }
35084 LOGGING_ACK_DATA::ID => Some(Self::LOGGING_ACK(LOGGING_ACK_DATA::default())),
35085 LOGGING_DATA_DATA::ID => Some(Self::LOGGING_DATA(LOGGING_DATA_DATA::default())),
35086 LOGGING_DATA_ACKED_DATA::ID => {
35087 Some(Self::LOGGING_DATA_ACKED(LOGGING_DATA_ACKED_DATA::default()))
35088 }
35089 LOG_DATA_DATA::ID => Some(Self::LOG_DATA(LOG_DATA_DATA::default())),
35090 LOG_ENTRY_DATA::ID => Some(Self::LOG_ENTRY(LOG_ENTRY_DATA::default())),
35091 LOG_ERASE_DATA::ID => Some(Self::LOG_ERASE(LOG_ERASE_DATA::default())),
35092 LOG_REQUEST_DATA_DATA::ID => {
35093 Some(Self::LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA::default()))
35094 }
35095 LOG_REQUEST_END_DATA::ID => {
35096 Some(Self::LOG_REQUEST_END(LOG_REQUEST_END_DATA::default()))
35097 }
35098 LOG_REQUEST_LIST_DATA::ID => {
35099 Some(Self::LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA::default()))
35100 }
35101 MAG_CAL_REPORT_DATA::ID => Some(Self::MAG_CAL_REPORT(MAG_CAL_REPORT_DATA::default())),
35102 MANUAL_CONTROL_DATA::ID => Some(Self::MANUAL_CONTROL(MANUAL_CONTROL_DATA::default())),
35103 MANUAL_SETPOINT_DATA::ID => {
35104 Some(Self::MANUAL_SETPOINT(MANUAL_SETPOINT_DATA::default()))
35105 }
35106 MEMORY_VECT_DATA::ID => Some(Self::MEMORY_VECT(MEMORY_VECT_DATA::default())),
35107 MESSAGE_INTERVAL_DATA::ID => {
35108 Some(Self::MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA::default()))
35109 }
35110 MISSION_ACK_DATA::ID => Some(Self::MISSION_ACK(MISSION_ACK_DATA::default())),
35111 MISSION_CLEAR_ALL_DATA::ID => {
35112 Some(Self::MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA::default()))
35113 }
35114 MISSION_COUNT_DATA::ID => Some(Self::MISSION_COUNT(MISSION_COUNT_DATA::default())),
35115 MISSION_CURRENT_DATA::ID => {
35116 Some(Self::MISSION_CURRENT(MISSION_CURRENT_DATA::default()))
35117 }
35118 MISSION_ITEM_DATA::ID => Some(Self::MISSION_ITEM(MISSION_ITEM_DATA::default())),
35119 MISSION_ITEM_INT_DATA::ID => {
35120 Some(Self::MISSION_ITEM_INT(MISSION_ITEM_INT_DATA::default()))
35121 }
35122 MISSION_ITEM_REACHED_DATA::ID => Some(Self::MISSION_ITEM_REACHED(
35123 MISSION_ITEM_REACHED_DATA::default(),
35124 )),
35125 MISSION_REQUEST_DATA::ID => {
35126 Some(Self::MISSION_REQUEST(MISSION_REQUEST_DATA::default()))
35127 }
35128 MISSION_REQUEST_INT_DATA::ID => Some(Self::MISSION_REQUEST_INT(
35129 MISSION_REQUEST_INT_DATA::default(),
35130 )),
35131 MISSION_REQUEST_LIST_DATA::ID => Some(Self::MISSION_REQUEST_LIST(
35132 MISSION_REQUEST_LIST_DATA::default(),
35133 )),
35134 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_REQUEST_PARTIAL_LIST(
35135 MISSION_REQUEST_PARTIAL_LIST_DATA::default(),
35136 )),
35137 MISSION_SET_CURRENT_DATA::ID => Some(Self::MISSION_SET_CURRENT(
35138 MISSION_SET_CURRENT_DATA::default(),
35139 )),
35140 MISSION_WRITE_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_WRITE_PARTIAL_LIST(
35141 MISSION_WRITE_PARTIAL_LIST_DATA::default(),
35142 )),
35143 MOUNT_ORIENTATION_DATA::ID => {
35144 Some(Self::MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA::default()))
35145 }
35146 NAMED_VALUE_FLOAT_DATA::ID => {
35147 Some(Self::NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA::default()))
35148 }
35149 NAMED_VALUE_INT_DATA::ID => {
35150 Some(Self::NAMED_VALUE_INT(NAMED_VALUE_INT_DATA::default()))
35151 }
35152 NAV_CONTROLLER_OUTPUT_DATA::ID => Some(Self::NAV_CONTROLLER_OUTPUT(
35153 NAV_CONTROLLER_OUTPUT_DATA::default(),
35154 )),
35155 NAV_FILTER_BIAS_DATA::ID => {
35156 Some(Self::NAV_FILTER_BIAS(NAV_FILTER_BIAS_DATA::default()))
35157 }
35158 OBSTACLE_DISTANCE_DATA::ID => {
35159 Some(Self::OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA::default()))
35160 }
35161 ODOMETRY_DATA::ID => Some(Self::ODOMETRY(ODOMETRY_DATA::default())),
35162 ONBOARD_COMPUTER_STATUS_DATA::ID => Some(Self::ONBOARD_COMPUTER_STATUS(
35163 ONBOARD_COMPUTER_STATUS_DATA::default(),
35164 )),
35165 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => Some(Self::OPEN_DRONE_ID_ARM_STATUS(
35166 OPEN_DRONE_ID_ARM_STATUS_DATA::default(),
35167 )),
35168 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => Some(Self::OPEN_DRONE_ID_AUTHENTICATION(
35169 OPEN_DRONE_ID_AUTHENTICATION_DATA::default(),
35170 )),
35171 OPEN_DRONE_ID_BASIC_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_BASIC_ID(
35172 OPEN_DRONE_ID_BASIC_ID_DATA::default(),
35173 )),
35174 OPEN_DRONE_ID_LOCATION_DATA::ID => Some(Self::OPEN_DRONE_ID_LOCATION(
35175 OPEN_DRONE_ID_LOCATION_DATA::default(),
35176 )),
35177 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => Some(Self::OPEN_DRONE_ID_MESSAGE_PACK(
35178 OPEN_DRONE_ID_MESSAGE_PACK_DATA::default(),
35179 )),
35180 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_OPERATOR_ID(
35181 OPEN_DRONE_ID_OPERATOR_ID_DATA::default(),
35182 )),
35183 OPEN_DRONE_ID_SELF_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_SELF_ID(
35184 OPEN_DRONE_ID_SELF_ID_DATA::default(),
35185 )),
35186 OPEN_DRONE_ID_SYSTEM_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM(
35187 OPEN_DRONE_ID_SYSTEM_DATA::default(),
35188 )),
35189 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM_UPDATE(
35190 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::default(),
35191 )),
35192 OPTICAL_FLOW_DATA::ID => Some(Self::OPTICAL_FLOW(OPTICAL_FLOW_DATA::default())),
35193 OPTICAL_FLOW_RAD_DATA::ID => {
35194 Some(Self::OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA::default()))
35195 }
35196 ORBIT_EXECUTION_STATUS_DATA::ID => Some(Self::ORBIT_EXECUTION_STATUS(
35197 ORBIT_EXECUTION_STATUS_DATA::default(),
35198 )),
35199 PARAM_EXT_ACK_DATA::ID => Some(Self::PARAM_EXT_ACK(PARAM_EXT_ACK_DATA::default())),
35200 PARAM_EXT_REQUEST_LIST_DATA::ID => Some(Self::PARAM_EXT_REQUEST_LIST(
35201 PARAM_EXT_REQUEST_LIST_DATA::default(),
35202 )),
35203 PARAM_EXT_REQUEST_READ_DATA::ID => Some(Self::PARAM_EXT_REQUEST_READ(
35204 PARAM_EXT_REQUEST_READ_DATA::default(),
35205 )),
35206 PARAM_EXT_SET_DATA::ID => Some(Self::PARAM_EXT_SET(PARAM_EXT_SET_DATA::default())),
35207 PARAM_EXT_VALUE_DATA::ID => {
35208 Some(Self::PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA::default()))
35209 }
35210 PARAM_MAP_RC_DATA::ID => Some(Self::PARAM_MAP_RC(PARAM_MAP_RC_DATA::default())),
35211 PARAM_REQUEST_LIST_DATA::ID => {
35212 Some(Self::PARAM_REQUEST_LIST(PARAM_REQUEST_LIST_DATA::default()))
35213 }
35214 PARAM_REQUEST_READ_DATA::ID => {
35215 Some(Self::PARAM_REQUEST_READ(PARAM_REQUEST_READ_DATA::default()))
35216 }
35217 PARAM_SET_DATA::ID => Some(Self::PARAM_SET(PARAM_SET_DATA::default())),
35218 PARAM_VALUE_DATA::ID => Some(Self::PARAM_VALUE(PARAM_VALUE_DATA::default())),
35219 PING_DATA::ID => Some(Self::PING(PING_DATA::default())),
35220 PLAY_TUNE_DATA::ID => Some(Self::PLAY_TUNE(PLAY_TUNE_DATA::default())),
35221 PLAY_TUNE_V2_DATA::ID => Some(Self::PLAY_TUNE_V2(PLAY_TUNE_V2_DATA::default())),
35222 POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::POSITION_TARGET_GLOBAL_INT(
35223 POSITION_TARGET_GLOBAL_INT_DATA::default(),
35224 )),
35225 POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::POSITION_TARGET_LOCAL_NED(
35226 POSITION_TARGET_LOCAL_NED_DATA::default(),
35227 )),
35228 POWER_STATUS_DATA::ID => Some(Self::POWER_STATUS(POWER_STATUS_DATA::default())),
35229 PROTOCOL_VERSION_DATA::ID => {
35230 Some(Self::PROTOCOL_VERSION(PROTOCOL_VERSION_DATA::default()))
35231 }
35232 RADIO_CALIBRATION_DATA::ID => {
35233 Some(Self::RADIO_CALIBRATION(RADIO_CALIBRATION_DATA::default()))
35234 }
35235 RADIO_STATUS_DATA::ID => Some(Self::RADIO_STATUS(RADIO_STATUS_DATA::default())),
35236 RAW_IMU_DATA::ID => Some(Self::RAW_IMU(RAW_IMU_DATA::default())),
35237 RAW_PRESSURE_DATA::ID => Some(Self::RAW_PRESSURE(RAW_PRESSURE_DATA::default())),
35238 RAW_RPM_DATA::ID => Some(Self::RAW_RPM(RAW_RPM_DATA::default())),
35239 RC_CHANNELS_DATA::ID => Some(Self::RC_CHANNELS(RC_CHANNELS_DATA::default())),
35240 RC_CHANNELS_OVERRIDE_DATA::ID => Some(Self::RC_CHANNELS_OVERRIDE(
35241 RC_CHANNELS_OVERRIDE_DATA::default(),
35242 )),
35243 RC_CHANNELS_RAW_DATA::ID => {
35244 Some(Self::RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA::default()))
35245 }
35246 RC_CHANNELS_SCALED_DATA::ID => {
35247 Some(Self::RC_CHANNELS_SCALED(RC_CHANNELS_SCALED_DATA::default()))
35248 }
35249 REQUEST_DATA_STREAM_DATA::ID => Some(Self::REQUEST_DATA_STREAM(
35250 REQUEST_DATA_STREAM_DATA::default(),
35251 )),
35252 REQUEST_EVENT_DATA::ID => Some(Self::REQUEST_EVENT(REQUEST_EVENT_DATA::default())),
35253 RESOURCE_REQUEST_DATA::ID => {
35254 Some(Self::RESOURCE_REQUEST(RESOURCE_REQUEST_DATA::default()))
35255 }
35256 RESPONSE_EVENT_ERROR_DATA::ID => Some(Self::RESPONSE_EVENT_ERROR(
35257 RESPONSE_EVENT_ERROR_DATA::default(),
35258 )),
35259 SAFETY_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_ALLOWED_AREA(
35260 SAFETY_ALLOWED_AREA_DATA::default(),
35261 )),
35262 SAFETY_SET_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_SET_ALLOWED_AREA(
35263 SAFETY_SET_ALLOWED_AREA_DATA::default(),
35264 )),
35265 SCALED_IMU_DATA::ID => Some(Self::SCALED_IMU(SCALED_IMU_DATA::default())),
35266 SCALED_IMU2_DATA::ID => Some(Self::SCALED_IMU2(SCALED_IMU2_DATA::default())),
35267 SCALED_IMU3_DATA::ID => Some(Self::SCALED_IMU3(SCALED_IMU3_DATA::default())),
35268 SCALED_PRESSURE_DATA::ID => {
35269 Some(Self::SCALED_PRESSURE(SCALED_PRESSURE_DATA::default()))
35270 }
35271 SCALED_PRESSURE2_DATA::ID => {
35272 Some(Self::SCALED_PRESSURE2(SCALED_PRESSURE2_DATA::default()))
35273 }
35274 SCALED_PRESSURE3_DATA::ID => {
35275 Some(Self::SCALED_PRESSURE3(SCALED_PRESSURE3_DATA::default()))
35276 }
35277 SERIAL_CONTROL_DATA::ID => Some(Self::SERIAL_CONTROL(SERIAL_CONTROL_DATA::default())),
35278 SERVO_OUTPUT_RAW_DATA::ID => {
35279 Some(Self::SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA::default()))
35280 }
35281 SETUP_SIGNING_DATA::ID => Some(Self::SETUP_SIGNING(SETUP_SIGNING_DATA::default())),
35282 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::SET_ACTUATOR_CONTROL_TARGET(
35283 SET_ACTUATOR_CONTROL_TARGET_DATA::default(),
35284 )),
35285 SET_ATTITUDE_TARGET_DATA::ID => Some(Self::SET_ATTITUDE_TARGET(
35286 SET_ATTITUDE_TARGET_DATA::default(),
35287 )),
35288 SET_GPS_GLOBAL_ORIGIN_DATA::ID => Some(Self::SET_GPS_GLOBAL_ORIGIN(
35289 SET_GPS_GLOBAL_ORIGIN_DATA::default(),
35290 )),
35291 SET_HOME_POSITION_DATA::ID => {
35292 Some(Self::SET_HOME_POSITION(SET_HOME_POSITION_DATA::default()))
35293 }
35294 SET_MODE_DATA::ID => Some(Self::SET_MODE(SET_MODE_DATA::default())),
35295 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::SET_POSITION_TARGET_GLOBAL_INT(
35296 SET_POSITION_TARGET_GLOBAL_INT_DATA::default(),
35297 )),
35298 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::SET_POSITION_TARGET_LOCAL_NED(
35299 SET_POSITION_TARGET_LOCAL_NED_DATA::default(),
35300 )),
35301 SIM_STATE_DATA::ID => Some(Self::SIM_STATE(SIM_STATE_DATA::default())),
35302 SMART_BATTERY_INFO_DATA::ID => {
35303 Some(Self::SMART_BATTERY_INFO(SMART_BATTERY_INFO_DATA::default()))
35304 }
35305 STATUSTEXT_DATA::ID => Some(Self::STATUSTEXT(STATUSTEXT_DATA::default())),
35306 STORAGE_INFORMATION_DATA::ID => Some(Self::STORAGE_INFORMATION(
35307 STORAGE_INFORMATION_DATA::default(),
35308 )),
35309 SUPPORTED_TUNES_DATA::ID => {
35310 Some(Self::SUPPORTED_TUNES(SUPPORTED_TUNES_DATA::default()))
35311 }
35312 SYSTEM_TIME_DATA::ID => Some(Self::SYSTEM_TIME(SYSTEM_TIME_DATA::default())),
35313 SYS_STATUS_DATA::ID => Some(Self::SYS_STATUS(SYS_STATUS_DATA::default())),
35314 TERRAIN_CHECK_DATA::ID => Some(Self::TERRAIN_CHECK(TERRAIN_CHECK_DATA::default())),
35315 TERRAIN_DATA_DATA::ID => Some(Self::TERRAIN_DATA(TERRAIN_DATA_DATA::default())),
35316 TERRAIN_REPORT_DATA::ID => Some(Self::TERRAIN_REPORT(TERRAIN_REPORT_DATA::default())),
35317 TERRAIN_REQUEST_DATA::ID => {
35318 Some(Self::TERRAIN_REQUEST(TERRAIN_REQUEST_DATA::default()))
35319 }
35320 TIMESYNC_DATA::ID => Some(Self::TIMESYNC(TIMESYNC_DATA::default())),
35321 TIME_ESTIMATE_TO_TARGET_DATA::ID => Some(Self::TIME_ESTIMATE_TO_TARGET(
35322 TIME_ESTIMATE_TO_TARGET_DATA::default(),
35323 )),
35324 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
35325 Some(Self::TRAJECTORY_REPRESENTATION_BEZIER(
35326 TRAJECTORY_REPRESENTATION_BEZIER_DATA::default(),
35327 ))
35328 }
35329 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
35330 Some(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(
35331 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::default(),
35332 ))
35333 }
35334 TUNNEL_DATA::ID => Some(Self::TUNNEL(TUNNEL_DATA::default())),
35335 UALBERTA_SYS_STATUS_DATA::ID => Some(Self::UALBERTA_SYS_STATUS(
35336 UALBERTA_SYS_STATUS_DATA::default(),
35337 )),
35338 UAVCAN_NODE_INFO_DATA::ID => {
35339 Some(Self::UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA::default()))
35340 }
35341 UAVCAN_NODE_STATUS_DATA::ID => {
35342 Some(Self::UAVCAN_NODE_STATUS(UAVCAN_NODE_STATUS_DATA::default()))
35343 }
35344 UTM_GLOBAL_POSITION_DATA::ID => Some(Self::UTM_GLOBAL_POSITION(
35345 UTM_GLOBAL_POSITION_DATA::default(),
35346 )),
35347 V2_EXTENSION_DATA::ID => Some(Self::V2_EXTENSION(V2_EXTENSION_DATA::default())),
35348 VFR_HUD_DATA::ID => Some(Self::VFR_HUD(VFR_HUD_DATA::default())),
35349 VIBRATION_DATA::ID => Some(Self::VIBRATION(VIBRATION_DATA::default())),
35350 VICON_POSITION_ESTIMATE_DATA::ID => Some(Self::VICON_POSITION_ESTIMATE(
35351 VICON_POSITION_ESTIMATE_DATA::default(),
35352 )),
35353 VIDEO_STREAM_INFORMATION_DATA::ID => Some(Self::VIDEO_STREAM_INFORMATION(
35354 VIDEO_STREAM_INFORMATION_DATA::default(),
35355 )),
35356 VIDEO_STREAM_STATUS_DATA::ID => Some(Self::VIDEO_STREAM_STATUS(
35357 VIDEO_STREAM_STATUS_DATA::default(),
35358 )),
35359 VISION_POSITION_ESTIMATE_DATA::ID => Some(Self::VISION_POSITION_ESTIMATE(
35360 VISION_POSITION_ESTIMATE_DATA::default(),
35361 )),
35362 VISION_SPEED_ESTIMATE_DATA::ID => Some(Self::VISION_SPEED_ESTIMATE(
35363 VISION_SPEED_ESTIMATE_DATA::default(),
35364 )),
35365 WHEEL_DISTANCE_DATA::ID => Some(Self::WHEEL_DISTANCE(WHEEL_DISTANCE_DATA::default())),
35366 WIFI_CONFIG_AP_DATA::ID => Some(Self::WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA::default())),
35367 WINCH_STATUS_DATA::ID => Some(Self::WINCH_STATUS(WINCH_STATUS_DATA::default())),
35368 WIND_COV_DATA::ID => Some(Self::WIND_COV(WIND_COV_DATA::default())),
35369 _ => None,
35370 }
35371 }
35372 #[cfg(feature = "arbitrary")]
35373 fn random_message_from_id<R: rand::RngCore>(id: u32, rng: &mut R) -> Option<Self> {
35374 match id {
35375 ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::ACTUATOR_CONTROL_TARGET(
35376 ACTUATOR_CONTROL_TARGET_DATA::random(rng),
35377 )),
35378 ACTUATOR_OUTPUT_STATUS_DATA::ID => Some(Self::ACTUATOR_OUTPUT_STATUS(
35379 ACTUATOR_OUTPUT_STATUS_DATA::random(rng),
35380 )),
35381 ADSB_VEHICLE_DATA::ID => Some(Self::ADSB_VEHICLE(ADSB_VEHICLE_DATA::random(rng))),
35382 AIS_VESSEL_DATA::ID => Some(Self::AIS_VESSEL(AIS_VESSEL_DATA::random(rng))),
35383 ALTITUDE_DATA::ID => Some(Self::ALTITUDE(ALTITUDE_DATA::random(rng))),
35384 ATTITUDE_DATA::ID => Some(Self::ATTITUDE(ATTITUDE_DATA::random(rng))),
35385 ATTITUDE_QUATERNION_DATA::ID => Some(Self::ATTITUDE_QUATERNION(
35386 ATTITUDE_QUATERNION_DATA::random(rng),
35387 )),
35388 ATTITUDE_QUATERNION_COV_DATA::ID => Some(Self::ATTITUDE_QUATERNION_COV(
35389 ATTITUDE_QUATERNION_COV_DATA::random(rng),
35390 )),
35391 ATTITUDE_TARGET_DATA::ID => {
35392 Some(Self::ATTITUDE_TARGET(ATTITUDE_TARGET_DATA::random(rng)))
35393 }
35394 ATT_POS_MOCAP_DATA::ID => Some(Self::ATT_POS_MOCAP(ATT_POS_MOCAP_DATA::random(rng))),
35395 AUTH_KEY_DATA::ID => Some(Self::AUTH_KEY(AUTH_KEY_DATA::random(rng))),
35396 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
35397 Some(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(
35398 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::random(rng),
35399 ))
35400 }
35401 AUTOPILOT_VERSION_DATA::ID => {
35402 Some(Self::AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA::random(rng)))
35403 }
35404 AVAILABLE_MODES_DATA::ID => {
35405 Some(Self::AVAILABLE_MODES(AVAILABLE_MODES_DATA::random(rng)))
35406 }
35407 AVAILABLE_MODES_MONITOR_DATA::ID => Some(Self::AVAILABLE_MODES_MONITOR(
35408 AVAILABLE_MODES_MONITOR_DATA::random(rng),
35409 )),
35410 BATTERY_INFO_DATA::ID => Some(Self::BATTERY_INFO(BATTERY_INFO_DATA::random(rng))),
35411 BATTERY_STATUS_DATA::ID => Some(Self::BATTERY_STATUS(BATTERY_STATUS_DATA::random(rng))),
35412 BUTTON_CHANGE_DATA::ID => Some(Self::BUTTON_CHANGE(BUTTON_CHANGE_DATA::random(rng))),
35413 CAMERA_CAPTURE_STATUS_DATA::ID => Some(Self::CAMERA_CAPTURE_STATUS(
35414 CAMERA_CAPTURE_STATUS_DATA::random(rng),
35415 )),
35416 CAMERA_FOV_STATUS_DATA::ID => {
35417 Some(Self::CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA::random(rng)))
35418 }
35419 CAMERA_IMAGE_CAPTURED_DATA::ID => Some(Self::CAMERA_IMAGE_CAPTURED(
35420 CAMERA_IMAGE_CAPTURED_DATA::random(rng),
35421 )),
35422 CAMERA_INFORMATION_DATA::ID => Some(Self::CAMERA_INFORMATION(
35423 CAMERA_INFORMATION_DATA::random(rng),
35424 )),
35425 CAMERA_SETTINGS_DATA::ID => {
35426 Some(Self::CAMERA_SETTINGS(CAMERA_SETTINGS_DATA::random(rng)))
35427 }
35428 CAMERA_THERMAL_RANGE_DATA::ID => Some(Self::CAMERA_THERMAL_RANGE(
35429 CAMERA_THERMAL_RANGE_DATA::random(rng),
35430 )),
35431 CAMERA_TRACKING_GEO_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_GEO_STATUS(
35432 CAMERA_TRACKING_GEO_STATUS_DATA::random(rng),
35433 )),
35434 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_IMAGE_STATUS(
35435 CAMERA_TRACKING_IMAGE_STATUS_DATA::random(rng),
35436 )),
35437 CAMERA_TRIGGER_DATA::ID => Some(Self::CAMERA_TRIGGER(CAMERA_TRIGGER_DATA::random(rng))),
35438 CANFD_FRAME_DATA::ID => Some(Self::CANFD_FRAME(CANFD_FRAME_DATA::random(rng))),
35439 CAN_FILTER_MODIFY_DATA::ID => {
35440 Some(Self::CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA::random(rng)))
35441 }
35442 CAN_FRAME_DATA::ID => Some(Self::CAN_FRAME(CAN_FRAME_DATA::random(rng))),
35443 CELLULAR_CONFIG_DATA::ID => {
35444 Some(Self::CELLULAR_CONFIG(CELLULAR_CONFIG_DATA::random(rng)))
35445 }
35446 CELLULAR_STATUS_DATA::ID => {
35447 Some(Self::CELLULAR_STATUS(CELLULAR_STATUS_DATA::random(rng)))
35448 }
35449 CHANGE_OPERATOR_CONTROL_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL(
35450 CHANGE_OPERATOR_CONTROL_DATA::random(rng),
35451 )),
35452 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL_ACK(
35453 CHANGE_OPERATOR_CONTROL_ACK_DATA::random(rng),
35454 )),
35455 COLLISION_DATA::ID => Some(Self::COLLISION(COLLISION_DATA::random(rng))),
35456 COMMAND_ACK_DATA::ID => Some(Self::COMMAND_ACK(COMMAND_ACK_DATA::random(rng))),
35457 COMMAND_CANCEL_DATA::ID => Some(Self::COMMAND_CANCEL(COMMAND_CANCEL_DATA::random(rng))),
35458 COMMAND_INT_DATA::ID => Some(Self::COMMAND_INT(COMMAND_INT_DATA::random(rng))),
35459 COMMAND_LONG_DATA::ID => Some(Self::COMMAND_LONG(COMMAND_LONG_DATA::random(rng))),
35460 COMPONENT_INFORMATION_DATA::ID => Some(Self::COMPONENT_INFORMATION(
35461 COMPONENT_INFORMATION_DATA::random(rng),
35462 )),
35463 COMPONENT_INFORMATION_BASIC_DATA::ID => Some(Self::COMPONENT_INFORMATION_BASIC(
35464 COMPONENT_INFORMATION_BASIC_DATA::random(rng),
35465 )),
35466 COMPONENT_METADATA_DATA::ID => Some(Self::COMPONENT_METADATA(
35467 COMPONENT_METADATA_DATA::random(rng),
35468 )),
35469 CONTROL_SYSTEM_STATE_DATA::ID => Some(Self::CONTROL_SYSTEM_STATE(
35470 CONTROL_SYSTEM_STATE_DATA::random(rng),
35471 )),
35472 CURRENT_EVENT_SEQUENCE_DATA::ID => Some(Self::CURRENT_EVENT_SEQUENCE(
35473 CURRENT_EVENT_SEQUENCE_DATA::random(rng),
35474 )),
35475 CURRENT_MODE_DATA::ID => Some(Self::CURRENT_MODE(CURRENT_MODE_DATA::random(rng))),
35476 DATA_STREAM_DATA::ID => Some(Self::DATA_STREAM(DATA_STREAM_DATA::random(rng))),
35477 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => Some(Self::DATA_TRANSMISSION_HANDSHAKE(
35478 DATA_TRANSMISSION_HANDSHAKE_DATA::random(rng),
35479 )),
35480 DEBUG_DATA::ID => Some(Self::DEBUG(DEBUG_DATA::random(rng))),
35481 DEBUG_FLOAT_ARRAY_DATA::ID => {
35482 Some(Self::DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA::random(rng)))
35483 }
35484 DEBUG_VECT_DATA::ID => Some(Self::DEBUG_VECT(DEBUG_VECT_DATA::random(rng))),
35485 DISTANCE_SENSOR_DATA::ID => {
35486 Some(Self::DISTANCE_SENSOR(DISTANCE_SENSOR_DATA::random(rng)))
35487 }
35488 EFI_STATUS_DATA::ID => Some(Self::EFI_STATUS(EFI_STATUS_DATA::random(rng))),
35489 ENCAPSULATED_DATA_DATA::ID => {
35490 Some(Self::ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA::random(rng)))
35491 }
35492 ESC_INFO_DATA::ID => Some(Self::ESC_INFO(ESC_INFO_DATA::random(rng))),
35493 ESC_STATUS_DATA::ID => Some(Self::ESC_STATUS(ESC_STATUS_DATA::random(rng))),
35494 ESTIMATOR_STATUS_DATA::ID => {
35495 Some(Self::ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA::random(rng)))
35496 }
35497 EVENT_DATA::ID => Some(Self::EVENT(EVENT_DATA::random(rng))),
35498 EXTENDED_SYS_STATE_DATA::ID => Some(Self::EXTENDED_SYS_STATE(
35499 EXTENDED_SYS_STATE_DATA::random(rng),
35500 )),
35501 FENCE_STATUS_DATA::ID => Some(Self::FENCE_STATUS(FENCE_STATUS_DATA::random(rng))),
35502 FILE_TRANSFER_PROTOCOL_DATA::ID => Some(Self::FILE_TRANSFER_PROTOCOL(
35503 FILE_TRANSFER_PROTOCOL_DATA::random(rng),
35504 )),
35505 FLIGHT_INFORMATION_DATA::ID => Some(Self::FLIGHT_INFORMATION(
35506 FLIGHT_INFORMATION_DATA::random(rng),
35507 )),
35508 FOLLOW_TARGET_DATA::ID => Some(Self::FOLLOW_TARGET(FOLLOW_TARGET_DATA::random(rng))),
35509 FUEL_STATUS_DATA::ID => Some(Self::FUEL_STATUS(FUEL_STATUS_DATA::random(rng))),
35510 GENERATOR_STATUS_DATA::ID => {
35511 Some(Self::GENERATOR_STATUS(GENERATOR_STATUS_DATA::random(rng)))
35512 }
35513 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => Some(Self::GIMBAL_DEVICE_ATTITUDE_STATUS(
35514 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::random(rng),
35515 )),
35516 GIMBAL_DEVICE_INFORMATION_DATA::ID => Some(Self::GIMBAL_DEVICE_INFORMATION(
35517 GIMBAL_DEVICE_INFORMATION_DATA::random(rng),
35518 )),
35519 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_DEVICE_SET_ATTITUDE(
35520 GIMBAL_DEVICE_SET_ATTITUDE_DATA::random(rng),
35521 )),
35522 GIMBAL_MANAGER_INFORMATION_DATA::ID => Some(Self::GIMBAL_MANAGER_INFORMATION(
35523 GIMBAL_MANAGER_INFORMATION_DATA::random(rng),
35524 )),
35525 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_ATTITUDE(
35526 GIMBAL_MANAGER_SET_ATTITUDE_DATA::random(rng),
35527 )),
35528 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
35529 Some(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(
35530 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::random(rng),
35531 ))
35532 }
35533 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_PITCHYAW(
35534 GIMBAL_MANAGER_SET_PITCHYAW_DATA::random(rng),
35535 )),
35536 GIMBAL_MANAGER_STATUS_DATA::ID => Some(Self::GIMBAL_MANAGER_STATUS(
35537 GIMBAL_MANAGER_STATUS_DATA::random(rng),
35538 )),
35539 GLOBAL_POSITION_INT_DATA::ID => Some(Self::GLOBAL_POSITION_INT(
35540 GLOBAL_POSITION_INT_DATA::random(rng),
35541 )),
35542 GLOBAL_POSITION_INT_COV_DATA::ID => Some(Self::GLOBAL_POSITION_INT_COV(
35543 GLOBAL_POSITION_INT_COV_DATA::random(rng),
35544 )),
35545 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
35546 Some(Self::GLOBAL_VISION_POSITION_ESTIMATE(
35547 GLOBAL_VISION_POSITION_ESTIMATE_DATA::random(rng),
35548 ))
35549 }
35550 GPS2_RAW_DATA::ID => Some(Self::GPS2_RAW(GPS2_RAW_DATA::random(rng))),
35551 GPS2_RTK_DATA::ID => Some(Self::GPS2_RTK(GPS2_RTK_DATA::random(rng))),
35552 GPS_GLOBAL_ORIGIN_DATA::ID => {
35553 Some(Self::GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA::random(rng)))
35554 }
35555 GPS_INJECT_DATA_DATA::ID => {
35556 Some(Self::GPS_INJECT_DATA(GPS_INJECT_DATA_DATA::random(rng)))
35557 }
35558 GPS_INPUT_DATA::ID => Some(Self::GPS_INPUT(GPS_INPUT_DATA::random(rng))),
35559 GPS_RAW_INT_DATA::ID => Some(Self::GPS_RAW_INT(GPS_RAW_INT_DATA::random(rng))),
35560 GPS_RTCM_DATA_DATA::ID => Some(Self::GPS_RTCM_DATA(GPS_RTCM_DATA_DATA::random(rng))),
35561 GPS_RTK_DATA::ID => Some(Self::GPS_RTK(GPS_RTK_DATA::random(rng))),
35562 GPS_STATUS_DATA::ID => Some(Self::GPS_STATUS(GPS_STATUS_DATA::random(rng))),
35563 HEARTBEAT_DATA::ID => Some(Self::HEARTBEAT(HEARTBEAT_DATA::random(rng))),
35564 HIGHRES_IMU_DATA::ID => Some(Self::HIGHRES_IMU(HIGHRES_IMU_DATA::random(rng))),
35565 HIGH_LATENCY_DATA::ID => Some(Self::HIGH_LATENCY(HIGH_LATENCY_DATA::random(rng))),
35566 HIGH_LATENCY2_DATA::ID => Some(Self::HIGH_LATENCY2(HIGH_LATENCY2_DATA::random(rng))),
35567 HIL_ACTUATOR_CONTROLS_DATA::ID => Some(Self::HIL_ACTUATOR_CONTROLS(
35568 HIL_ACTUATOR_CONTROLS_DATA::random(rng),
35569 )),
35570 HIL_CONTROLS_DATA::ID => Some(Self::HIL_CONTROLS(HIL_CONTROLS_DATA::random(rng))),
35571 HIL_GPS_DATA::ID => Some(Self::HIL_GPS(HIL_GPS_DATA::random(rng))),
35572 HIL_OPTICAL_FLOW_DATA::ID => {
35573 Some(Self::HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA::random(rng)))
35574 }
35575 HIL_RC_INPUTS_RAW_DATA::ID => {
35576 Some(Self::HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA::random(rng)))
35577 }
35578 HIL_SENSOR_DATA::ID => Some(Self::HIL_SENSOR(HIL_SENSOR_DATA::random(rng))),
35579 HIL_STATE_DATA::ID => Some(Self::HIL_STATE(HIL_STATE_DATA::random(rng))),
35580 HIL_STATE_QUATERNION_DATA::ID => Some(Self::HIL_STATE_QUATERNION(
35581 HIL_STATE_QUATERNION_DATA::random(rng),
35582 )),
35583 HOME_POSITION_DATA::ID => Some(Self::HOME_POSITION(HOME_POSITION_DATA::random(rng))),
35584 HYGROMETER_SENSOR_DATA::ID => {
35585 Some(Self::HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA::random(rng)))
35586 }
35587 ILLUMINATOR_STATUS_DATA::ID => Some(Self::ILLUMINATOR_STATUS(
35588 ILLUMINATOR_STATUS_DATA::random(rng),
35589 )),
35590 ISBD_LINK_STATUS_DATA::ID => {
35591 Some(Self::ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA::random(rng)))
35592 }
35593 LANDING_TARGET_DATA::ID => Some(Self::LANDING_TARGET(LANDING_TARGET_DATA::random(rng))),
35594 LINK_NODE_STATUS_DATA::ID => {
35595 Some(Self::LINK_NODE_STATUS(LINK_NODE_STATUS_DATA::random(rng)))
35596 }
35597 LOCAL_POSITION_NED_DATA::ID => Some(Self::LOCAL_POSITION_NED(
35598 LOCAL_POSITION_NED_DATA::random(rng),
35599 )),
35600 LOCAL_POSITION_NED_COV_DATA::ID => Some(Self::LOCAL_POSITION_NED_COV(
35601 LOCAL_POSITION_NED_COV_DATA::random(rng),
35602 )),
35603 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
35604 Some(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(
35605 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::random(rng),
35606 ))
35607 }
35608 LOGGING_ACK_DATA::ID => Some(Self::LOGGING_ACK(LOGGING_ACK_DATA::random(rng))),
35609 LOGGING_DATA_DATA::ID => Some(Self::LOGGING_DATA(LOGGING_DATA_DATA::random(rng))),
35610 LOGGING_DATA_ACKED_DATA::ID => Some(Self::LOGGING_DATA_ACKED(
35611 LOGGING_DATA_ACKED_DATA::random(rng),
35612 )),
35613 LOG_DATA_DATA::ID => Some(Self::LOG_DATA(LOG_DATA_DATA::random(rng))),
35614 LOG_ENTRY_DATA::ID => Some(Self::LOG_ENTRY(LOG_ENTRY_DATA::random(rng))),
35615 LOG_ERASE_DATA::ID => Some(Self::LOG_ERASE(LOG_ERASE_DATA::random(rng))),
35616 LOG_REQUEST_DATA_DATA::ID => {
35617 Some(Self::LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA::random(rng)))
35618 }
35619 LOG_REQUEST_END_DATA::ID => {
35620 Some(Self::LOG_REQUEST_END(LOG_REQUEST_END_DATA::random(rng)))
35621 }
35622 LOG_REQUEST_LIST_DATA::ID => {
35623 Some(Self::LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA::random(rng)))
35624 }
35625 MAG_CAL_REPORT_DATA::ID => Some(Self::MAG_CAL_REPORT(MAG_CAL_REPORT_DATA::random(rng))),
35626 MANUAL_CONTROL_DATA::ID => Some(Self::MANUAL_CONTROL(MANUAL_CONTROL_DATA::random(rng))),
35627 MANUAL_SETPOINT_DATA::ID => {
35628 Some(Self::MANUAL_SETPOINT(MANUAL_SETPOINT_DATA::random(rng)))
35629 }
35630 MEMORY_VECT_DATA::ID => Some(Self::MEMORY_VECT(MEMORY_VECT_DATA::random(rng))),
35631 MESSAGE_INTERVAL_DATA::ID => {
35632 Some(Self::MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA::random(rng)))
35633 }
35634 MISSION_ACK_DATA::ID => Some(Self::MISSION_ACK(MISSION_ACK_DATA::random(rng))),
35635 MISSION_CLEAR_ALL_DATA::ID => {
35636 Some(Self::MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA::random(rng)))
35637 }
35638 MISSION_COUNT_DATA::ID => Some(Self::MISSION_COUNT(MISSION_COUNT_DATA::random(rng))),
35639 MISSION_CURRENT_DATA::ID => {
35640 Some(Self::MISSION_CURRENT(MISSION_CURRENT_DATA::random(rng)))
35641 }
35642 MISSION_ITEM_DATA::ID => Some(Self::MISSION_ITEM(MISSION_ITEM_DATA::random(rng))),
35643 MISSION_ITEM_INT_DATA::ID => {
35644 Some(Self::MISSION_ITEM_INT(MISSION_ITEM_INT_DATA::random(rng)))
35645 }
35646 MISSION_ITEM_REACHED_DATA::ID => Some(Self::MISSION_ITEM_REACHED(
35647 MISSION_ITEM_REACHED_DATA::random(rng),
35648 )),
35649 MISSION_REQUEST_DATA::ID => {
35650 Some(Self::MISSION_REQUEST(MISSION_REQUEST_DATA::random(rng)))
35651 }
35652 MISSION_REQUEST_INT_DATA::ID => Some(Self::MISSION_REQUEST_INT(
35653 MISSION_REQUEST_INT_DATA::random(rng),
35654 )),
35655 MISSION_REQUEST_LIST_DATA::ID => Some(Self::MISSION_REQUEST_LIST(
35656 MISSION_REQUEST_LIST_DATA::random(rng),
35657 )),
35658 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_REQUEST_PARTIAL_LIST(
35659 MISSION_REQUEST_PARTIAL_LIST_DATA::random(rng),
35660 )),
35661 MISSION_SET_CURRENT_DATA::ID => Some(Self::MISSION_SET_CURRENT(
35662 MISSION_SET_CURRENT_DATA::random(rng),
35663 )),
35664 MISSION_WRITE_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_WRITE_PARTIAL_LIST(
35665 MISSION_WRITE_PARTIAL_LIST_DATA::random(rng),
35666 )),
35667 MOUNT_ORIENTATION_DATA::ID => {
35668 Some(Self::MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA::random(rng)))
35669 }
35670 NAMED_VALUE_FLOAT_DATA::ID => {
35671 Some(Self::NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA::random(rng)))
35672 }
35673 NAMED_VALUE_INT_DATA::ID => {
35674 Some(Self::NAMED_VALUE_INT(NAMED_VALUE_INT_DATA::random(rng)))
35675 }
35676 NAV_CONTROLLER_OUTPUT_DATA::ID => Some(Self::NAV_CONTROLLER_OUTPUT(
35677 NAV_CONTROLLER_OUTPUT_DATA::random(rng),
35678 )),
35679 NAV_FILTER_BIAS_DATA::ID => {
35680 Some(Self::NAV_FILTER_BIAS(NAV_FILTER_BIAS_DATA::random(rng)))
35681 }
35682 OBSTACLE_DISTANCE_DATA::ID => {
35683 Some(Self::OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA::random(rng)))
35684 }
35685 ODOMETRY_DATA::ID => Some(Self::ODOMETRY(ODOMETRY_DATA::random(rng))),
35686 ONBOARD_COMPUTER_STATUS_DATA::ID => Some(Self::ONBOARD_COMPUTER_STATUS(
35687 ONBOARD_COMPUTER_STATUS_DATA::random(rng),
35688 )),
35689 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => Some(Self::OPEN_DRONE_ID_ARM_STATUS(
35690 OPEN_DRONE_ID_ARM_STATUS_DATA::random(rng),
35691 )),
35692 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => Some(Self::OPEN_DRONE_ID_AUTHENTICATION(
35693 OPEN_DRONE_ID_AUTHENTICATION_DATA::random(rng),
35694 )),
35695 OPEN_DRONE_ID_BASIC_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_BASIC_ID(
35696 OPEN_DRONE_ID_BASIC_ID_DATA::random(rng),
35697 )),
35698 OPEN_DRONE_ID_LOCATION_DATA::ID => Some(Self::OPEN_DRONE_ID_LOCATION(
35699 OPEN_DRONE_ID_LOCATION_DATA::random(rng),
35700 )),
35701 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => Some(Self::OPEN_DRONE_ID_MESSAGE_PACK(
35702 OPEN_DRONE_ID_MESSAGE_PACK_DATA::random(rng),
35703 )),
35704 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_OPERATOR_ID(
35705 OPEN_DRONE_ID_OPERATOR_ID_DATA::random(rng),
35706 )),
35707 OPEN_DRONE_ID_SELF_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_SELF_ID(
35708 OPEN_DRONE_ID_SELF_ID_DATA::random(rng),
35709 )),
35710 OPEN_DRONE_ID_SYSTEM_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM(
35711 OPEN_DRONE_ID_SYSTEM_DATA::random(rng),
35712 )),
35713 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM_UPDATE(
35714 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::random(rng),
35715 )),
35716 OPTICAL_FLOW_DATA::ID => Some(Self::OPTICAL_FLOW(OPTICAL_FLOW_DATA::random(rng))),
35717 OPTICAL_FLOW_RAD_DATA::ID => {
35718 Some(Self::OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA::random(rng)))
35719 }
35720 ORBIT_EXECUTION_STATUS_DATA::ID => Some(Self::ORBIT_EXECUTION_STATUS(
35721 ORBIT_EXECUTION_STATUS_DATA::random(rng),
35722 )),
35723 PARAM_EXT_ACK_DATA::ID => Some(Self::PARAM_EXT_ACK(PARAM_EXT_ACK_DATA::random(rng))),
35724 PARAM_EXT_REQUEST_LIST_DATA::ID => Some(Self::PARAM_EXT_REQUEST_LIST(
35725 PARAM_EXT_REQUEST_LIST_DATA::random(rng),
35726 )),
35727 PARAM_EXT_REQUEST_READ_DATA::ID => Some(Self::PARAM_EXT_REQUEST_READ(
35728 PARAM_EXT_REQUEST_READ_DATA::random(rng),
35729 )),
35730 PARAM_EXT_SET_DATA::ID => Some(Self::PARAM_EXT_SET(PARAM_EXT_SET_DATA::random(rng))),
35731 PARAM_EXT_VALUE_DATA::ID => {
35732 Some(Self::PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA::random(rng)))
35733 }
35734 PARAM_MAP_RC_DATA::ID => Some(Self::PARAM_MAP_RC(PARAM_MAP_RC_DATA::random(rng))),
35735 PARAM_REQUEST_LIST_DATA::ID => Some(Self::PARAM_REQUEST_LIST(
35736 PARAM_REQUEST_LIST_DATA::random(rng),
35737 )),
35738 PARAM_REQUEST_READ_DATA::ID => Some(Self::PARAM_REQUEST_READ(
35739 PARAM_REQUEST_READ_DATA::random(rng),
35740 )),
35741 PARAM_SET_DATA::ID => Some(Self::PARAM_SET(PARAM_SET_DATA::random(rng))),
35742 PARAM_VALUE_DATA::ID => Some(Self::PARAM_VALUE(PARAM_VALUE_DATA::random(rng))),
35743 PING_DATA::ID => Some(Self::PING(PING_DATA::random(rng))),
35744 PLAY_TUNE_DATA::ID => Some(Self::PLAY_TUNE(PLAY_TUNE_DATA::random(rng))),
35745 PLAY_TUNE_V2_DATA::ID => Some(Self::PLAY_TUNE_V2(PLAY_TUNE_V2_DATA::random(rng))),
35746 POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::POSITION_TARGET_GLOBAL_INT(
35747 POSITION_TARGET_GLOBAL_INT_DATA::random(rng),
35748 )),
35749 POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::POSITION_TARGET_LOCAL_NED(
35750 POSITION_TARGET_LOCAL_NED_DATA::random(rng),
35751 )),
35752 POWER_STATUS_DATA::ID => Some(Self::POWER_STATUS(POWER_STATUS_DATA::random(rng))),
35753 PROTOCOL_VERSION_DATA::ID => {
35754 Some(Self::PROTOCOL_VERSION(PROTOCOL_VERSION_DATA::random(rng)))
35755 }
35756 RADIO_CALIBRATION_DATA::ID => {
35757 Some(Self::RADIO_CALIBRATION(RADIO_CALIBRATION_DATA::random(rng)))
35758 }
35759 RADIO_STATUS_DATA::ID => Some(Self::RADIO_STATUS(RADIO_STATUS_DATA::random(rng))),
35760 RAW_IMU_DATA::ID => Some(Self::RAW_IMU(RAW_IMU_DATA::random(rng))),
35761 RAW_PRESSURE_DATA::ID => Some(Self::RAW_PRESSURE(RAW_PRESSURE_DATA::random(rng))),
35762 RAW_RPM_DATA::ID => Some(Self::RAW_RPM(RAW_RPM_DATA::random(rng))),
35763 RC_CHANNELS_DATA::ID => Some(Self::RC_CHANNELS(RC_CHANNELS_DATA::random(rng))),
35764 RC_CHANNELS_OVERRIDE_DATA::ID => Some(Self::RC_CHANNELS_OVERRIDE(
35765 RC_CHANNELS_OVERRIDE_DATA::random(rng),
35766 )),
35767 RC_CHANNELS_RAW_DATA::ID => {
35768 Some(Self::RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA::random(rng)))
35769 }
35770 RC_CHANNELS_SCALED_DATA::ID => Some(Self::RC_CHANNELS_SCALED(
35771 RC_CHANNELS_SCALED_DATA::random(rng),
35772 )),
35773 REQUEST_DATA_STREAM_DATA::ID => Some(Self::REQUEST_DATA_STREAM(
35774 REQUEST_DATA_STREAM_DATA::random(rng),
35775 )),
35776 REQUEST_EVENT_DATA::ID => Some(Self::REQUEST_EVENT(REQUEST_EVENT_DATA::random(rng))),
35777 RESOURCE_REQUEST_DATA::ID => {
35778 Some(Self::RESOURCE_REQUEST(RESOURCE_REQUEST_DATA::random(rng)))
35779 }
35780 RESPONSE_EVENT_ERROR_DATA::ID => Some(Self::RESPONSE_EVENT_ERROR(
35781 RESPONSE_EVENT_ERROR_DATA::random(rng),
35782 )),
35783 SAFETY_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_ALLOWED_AREA(
35784 SAFETY_ALLOWED_AREA_DATA::random(rng),
35785 )),
35786 SAFETY_SET_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_SET_ALLOWED_AREA(
35787 SAFETY_SET_ALLOWED_AREA_DATA::random(rng),
35788 )),
35789 SCALED_IMU_DATA::ID => Some(Self::SCALED_IMU(SCALED_IMU_DATA::random(rng))),
35790 SCALED_IMU2_DATA::ID => Some(Self::SCALED_IMU2(SCALED_IMU2_DATA::random(rng))),
35791 SCALED_IMU3_DATA::ID => Some(Self::SCALED_IMU3(SCALED_IMU3_DATA::random(rng))),
35792 SCALED_PRESSURE_DATA::ID => {
35793 Some(Self::SCALED_PRESSURE(SCALED_PRESSURE_DATA::random(rng)))
35794 }
35795 SCALED_PRESSURE2_DATA::ID => {
35796 Some(Self::SCALED_PRESSURE2(SCALED_PRESSURE2_DATA::random(rng)))
35797 }
35798 SCALED_PRESSURE3_DATA::ID => {
35799 Some(Self::SCALED_PRESSURE3(SCALED_PRESSURE3_DATA::random(rng)))
35800 }
35801 SERIAL_CONTROL_DATA::ID => Some(Self::SERIAL_CONTROL(SERIAL_CONTROL_DATA::random(rng))),
35802 SERVO_OUTPUT_RAW_DATA::ID => {
35803 Some(Self::SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA::random(rng)))
35804 }
35805 SETUP_SIGNING_DATA::ID => Some(Self::SETUP_SIGNING(SETUP_SIGNING_DATA::random(rng))),
35806 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::SET_ACTUATOR_CONTROL_TARGET(
35807 SET_ACTUATOR_CONTROL_TARGET_DATA::random(rng),
35808 )),
35809 SET_ATTITUDE_TARGET_DATA::ID => Some(Self::SET_ATTITUDE_TARGET(
35810 SET_ATTITUDE_TARGET_DATA::random(rng),
35811 )),
35812 SET_GPS_GLOBAL_ORIGIN_DATA::ID => Some(Self::SET_GPS_GLOBAL_ORIGIN(
35813 SET_GPS_GLOBAL_ORIGIN_DATA::random(rng),
35814 )),
35815 SET_HOME_POSITION_DATA::ID => {
35816 Some(Self::SET_HOME_POSITION(SET_HOME_POSITION_DATA::random(rng)))
35817 }
35818 SET_MODE_DATA::ID => Some(Self::SET_MODE(SET_MODE_DATA::random(rng))),
35819 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::SET_POSITION_TARGET_GLOBAL_INT(
35820 SET_POSITION_TARGET_GLOBAL_INT_DATA::random(rng),
35821 )),
35822 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::SET_POSITION_TARGET_LOCAL_NED(
35823 SET_POSITION_TARGET_LOCAL_NED_DATA::random(rng),
35824 )),
35825 SIM_STATE_DATA::ID => Some(Self::SIM_STATE(SIM_STATE_DATA::random(rng))),
35826 SMART_BATTERY_INFO_DATA::ID => Some(Self::SMART_BATTERY_INFO(
35827 SMART_BATTERY_INFO_DATA::random(rng),
35828 )),
35829 STATUSTEXT_DATA::ID => Some(Self::STATUSTEXT(STATUSTEXT_DATA::random(rng))),
35830 STORAGE_INFORMATION_DATA::ID => Some(Self::STORAGE_INFORMATION(
35831 STORAGE_INFORMATION_DATA::random(rng),
35832 )),
35833 SUPPORTED_TUNES_DATA::ID => {
35834 Some(Self::SUPPORTED_TUNES(SUPPORTED_TUNES_DATA::random(rng)))
35835 }
35836 SYSTEM_TIME_DATA::ID => Some(Self::SYSTEM_TIME(SYSTEM_TIME_DATA::random(rng))),
35837 SYS_STATUS_DATA::ID => Some(Self::SYS_STATUS(SYS_STATUS_DATA::random(rng))),
35838 TERRAIN_CHECK_DATA::ID => Some(Self::TERRAIN_CHECK(TERRAIN_CHECK_DATA::random(rng))),
35839 TERRAIN_DATA_DATA::ID => Some(Self::TERRAIN_DATA(TERRAIN_DATA_DATA::random(rng))),
35840 TERRAIN_REPORT_DATA::ID => Some(Self::TERRAIN_REPORT(TERRAIN_REPORT_DATA::random(rng))),
35841 TERRAIN_REQUEST_DATA::ID => {
35842 Some(Self::TERRAIN_REQUEST(TERRAIN_REQUEST_DATA::random(rng)))
35843 }
35844 TIMESYNC_DATA::ID => Some(Self::TIMESYNC(TIMESYNC_DATA::random(rng))),
35845 TIME_ESTIMATE_TO_TARGET_DATA::ID => Some(Self::TIME_ESTIMATE_TO_TARGET(
35846 TIME_ESTIMATE_TO_TARGET_DATA::random(rng),
35847 )),
35848 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
35849 Some(Self::TRAJECTORY_REPRESENTATION_BEZIER(
35850 TRAJECTORY_REPRESENTATION_BEZIER_DATA::random(rng),
35851 ))
35852 }
35853 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
35854 Some(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(
35855 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::random(rng),
35856 ))
35857 }
35858 TUNNEL_DATA::ID => Some(Self::TUNNEL(TUNNEL_DATA::random(rng))),
35859 UALBERTA_SYS_STATUS_DATA::ID => Some(Self::UALBERTA_SYS_STATUS(
35860 UALBERTA_SYS_STATUS_DATA::random(rng),
35861 )),
35862 UAVCAN_NODE_INFO_DATA::ID => {
35863 Some(Self::UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA::random(rng)))
35864 }
35865 UAVCAN_NODE_STATUS_DATA::ID => Some(Self::UAVCAN_NODE_STATUS(
35866 UAVCAN_NODE_STATUS_DATA::random(rng),
35867 )),
35868 UTM_GLOBAL_POSITION_DATA::ID => Some(Self::UTM_GLOBAL_POSITION(
35869 UTM_GLOBAL_POSITION_DATA::random(rng),
35870 )),
35871 V2_EXTENSION_DATA::ID => Some(Self::V2_EXTENSION(V2_EXTENSION_DATA::random(rng))),
35872 VFR_HUD_DATA::ID => Some(Self::VFR_HUD(VFR_HUD_DATA::random(rng))),
35873 VIBRATION_DATA::ID => Some(Self::VIBRATION(VIBRATION_DATA::random(rng))),
35874 VICON_POSITION_ESTIMATE_DATA::ID => Some(Self::VICON_POSITION_ESTIMATE(
35875 VICON_POSITION_ESTIMATE_DATA::random(rng),
35876 )),
35877 VIDEO_STREAM_INFORMATION_DATA::ID => Some(Self::VIDEO_STREAM_INFORMATION(
35878 VIDEO_STREAM_INFORMATION_DATA::random(rng),
35879 )),
35880 VIDEO_STREAM_STATUS_DATA::ID => Some(Self::VIDEO_STREAM_STATUS(
35881 VIDEO_STREAM_STATUS_DATA::random(rng),
35882 )),
35883 VISION_POSITION_ESTIMATE_DATA::ID => Some(Self::VISION_POSITION_ESTIMATE(
35884 VISION_POSITION_ESTIMATE_DATA::random(rng),
35885 )),
35886 VISION_SPEED_ESTIMATE_DATA::ID => Some(Self::VISION_SPEED_ESTIMATE(
35887 VISION_SPEED_ESTIMATE_DATA::random(rng),
35888 )),
35889 WHEEL_DISTANCE_DATA::ID => Some(Self::WHEEL_DISTANCE(WHEEL_DISTANCE_DATA::random(rng))),
35890 WIFI_CONFIG_AP_DATA::ID => Some(Self::WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA::random(rng))),
35891 WINCH_STATUS_DATA::ID => Some(Self::WINCH_STATUS(WINCH_STATUS_DATA::random(rng))),
35892 WIND_COV_DATA::ID => Some(Self::WIND_COV(WIND_COV_DATA::random(rng))),
35893 _ => None,
35894 }
35895 }
35896 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
35897 match self {
35898 Self::ACTUATOR_CONTROL_TARGET(body) => body.ser(version, bytes),
35899 Self::ACTUATOR_OUTPUT_STATUS(body) => body.ser(version, bytes),
35900 Self::ADSB_VEHICLE(body) => body.ser(version, bytes),
35901 Self::AIS_VESSEL(body) => body.ser(version, bytes),
35902 Self::ALTITUDE(body) => body.ser(version, bytes),
35903 Self::ATTITUDE(body) => body.ser(version, bytes),
35904 Self::ATTITUDE_QUATERNION(body) => body.ser(version, bytes),
35905 Self::ATTITUDE_QUATERNION_COV(body) => body.ser(version, bytes),
35906 Self::ATTITUDE_TARGET(body) => body.ser(version, bytes),
35907 Self::ATT_POS_MOCAP(body) => body.ser(version, bytes),
35908 Self::AUTH_KEY(body) => body.ser(version, bytes),
35909 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(body) => body.ser(version, bytes),
35910 Self::AUTOPILOT_VERSION(body) => body.ser(version, bytes),
35911 Self::AVAILABLE_MODES(body) => body.ser(version, bytes),
35912 Self::AVAILABLE_MODES_MONITOR(body) => body.ser(version, bytes),
35913 Self::BATTERY_INFO(body) => body.ser(version, bytes),
35914 Self::BATTERY_STATUS(body) => body.ser(version, bytes),
35915 Self::BUTTON_CHANGE(body) => body.ser(version, bytes),
35916 Self::CAMERA_CAPTURE_STATUS(body) => body.ser(version, bytes),
35917 Self::CAMERA_FOV_STATUS(body) => body.ser(version, bytes),
35918 Self::CAMERA_IMAGE_CAPTURED(body) => body.ser(version, bytes),
35919 Self::CAMERA_INFORMATION(body) => body.ser(version, bytes),
35920 Self::CAMERA_SETTINGS(body) => body.ser(version, bytes),
35921 Self::CAMERA_THERMAL_RANGE(body) => body.ser(version, bytes),
35922 Self::CAMERA_TRACKING_GEO_STATUS(body) => body.ser(version, bytes),
35923 Self::CAMERA_TRACKING_IMAGE_STATUS(body) => body.ser(version, bytes),
35924 Self::CAMERA_TRIGGER(body) => body.ser(version, bytes),
35925 Self::CANFD_FRAME(body) => body.ser(version, bytes),
35926 Self::CAN_FILTER_MODIFY(body) => body.ser(version, bytes),
35927 Self::CAN_FRAME(body) => body.ser(version, bytes),
35928 Self::CELLULAR_CONFIG(body) => body.ser(version, bytes),
35929 Self::CELLULAR_STATUS(body) => body.ser(version, bytes),
35930 Self::CHANGE_OPERATOR_CONTROL(body) => body.ser(version, bytes),
35931 Self::CHANGE_OPERATOR_CONTROL_ACK(body) => body.ser(version, bytes),
35932 Self::COLLISION(body) => body.ser(version, bytes),
35933 Self::COMMAND_ACK(body) => body.ser(version, bytes),
35934 Self::COMMAND_CANCEL(body) => body.ser(version, bytes),
35935 Self::COMMAND_INT(body) => body.ser(version, bytes),
35936 Self::COMMAND_LONG(body) => body.ser(version, bytes),
35937 Self::COMPONENT_INFORMATION(body) => body.ser(version, bytes),
35938 Self::COMPONENT_INFORMATION_BASIC(body) => body.ser(version, bytes),
35939 Self::COMPONENT_METADATA(body) => body.ser(version, bytes),
35940 Self::CONTROL_SYSTEM_STATE(body) => body.ser(version, bytes),
35941 Self::CURRENT_EVENT_SEQUENCE(body) => body.ser(version, bytes),
35942 Self::CURRENT_MODE(body) => body.ser(version, bytes),
35943 Self::DATA_STREAM(body) => body.ser(version, bytes),
35944 Self::DATA_TRANSMISSION_HANDSHAKE(body) => body.ser(version, bytes),
35945 Self::DEBUG(body) => body.ser(version, bytes),
35946 Self::DEBUG_FLOAT_ARRAY(body) => body.ser(version, bytes),
35947 Self::DEBUG_VECT(body) => body.ser(version, bytes),
35948 Self::DISTANCE_SENSOR(body) => body.ser(version, bytes),
35949 Self::EFI_STATUS(body) => body.ser(version, bytes),
35950 Self::ENCAPSULATED_DATA(body) => body.ser(version, bytes),
35951 Self::ESC_INFO(body) => body.ser(version, bytes),
35952 Self::ESC_STATUS(body) => body.ser(version, bytes),
35953 Self::ESTIMATOR_STATUS(body) => body.ser(version, bytes),
35954 Self::EVENT(body) => body.ser(version, bytes),
35955 Self::EXTENDED_SYS_STATE(body) => body.ser(version, bytes),
35956 Self::FENCE_STATUS(body) => body.ser(version, bytes),
35957 Self::FILE_TRANSFER_PROTOCOL(body) => body.ser(version, bytes),
35958 Self::FLIGHT_INFORMATION(body) => body.ser(version, bytes),
35959 Self::FOLLOW_TARGET(body) => body.ser(version, bytes),
35960 Self::FUEL_STATUS(body) => body.ser(version, bytes),
35961 Self::GENERATOR_STATUS(body) => body.ser(version, bytes),
35962 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(body) => body.ser(version, bytes),
35963 Self::GIMBAL_DEVICE_INFORMATION(body) => body.ser(version, bytes),
35964 Self::GIMBAL_DEVICE_SET_ATTITUDE(body) => body.ser(version, bytes),
35965 Self::GIMBAL_MANAGER_INFORMATION(body) => body.ser(version, bytes),
35966 Self::GIMBAL_MANAGER_SET_ATTITUDE(body) => body.ser(version, bytes),
35967 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(body) => body.ser(version, bytes),
35968 Self::GIMBAL_MANAGER_SET_PITCHYAW(body) => body.ser(version, bytes),
35969 Self::GIMBAL_MANAGER_STATUS(body) => body.ser(version, bytes),
35970 Self::GLOBAL_POSITION_INT(body) => body.ser(version, bytes),
35971 Self::GLOBAL_POSITION_INT_COV(body) => body.ser(version, bytes),
35972 Self::GLOBAL_VISION_POSITION_ESTIMATE(body) => body.ser(version, bytes),
35973 Self::GPS2_RAW(body) => body.ser(version, bytes),
35974 Self::GPS2_RTK(body) => body.ser(version, bytes),
35975 Self::GPS_GLOBAL_ORIGIN(body) => body.ser(version, bytes),
35976 Self::GPS_INJECT_DATA(body) => body.ser(version, bytes),
35977 Self::GPS_INPUT(body) => body.ser(version, bytes),
35978 Self::GPS_RAW_INT(body) => body.ser(version, bytes),
35979 Self::GPS_RTCM_DATA(body) => body.ser(version, bytes),
35980 Self::GPS_RTK(body) => body.ser(version, bytes),
35981 Self::GPS_STATUS(body) => body.ser(version, bytes),
35982 Self::HEARTBEAT(body) => body.ser(version, bytes),
35983 Self::HIGHRES_IMU(body) => body.ser(version, bytes),
35984 Self::HIGH_LATENCY(body) => body.ser(version, bytes),
35985 Self::HIGH_LATENCY2(body) => body.ser(version, bytes),
35986 Self::HIL_ACTUATOR_CONTROLS(body) => body.ser(version, bytes),
35987 Self::HIL_CONTROLS(body) => body.ser(version, bytes),
35988 Self::HIL_GPS(body) => body.ser(version, bytes),
35989 Self::HIL_OPTICAL_FLOW(body) => body.ser(version, bytes),
35990 Self::HIL_RC_INPUTS_RAW(body) => body.ser(version, bytes),
35991 Self::HIL_SENSOR(body) => body.ser(version, bytes),
35992 Self::HIL_STATE(body) => body.ser(version, bytes),
35993 Self::HIL_STATE_QUATERNION(body) => body.ser(version, bytes),
35994 Self::HOME_POSITION(body) => body.ser(version, bytes),
35995 Self::HYGROMETER_SENSOR(body) => body.ser(version, bytes),
35996 Self::ILLUMINATOR_STATUS(body) => body.ser(version, bytes),
35997 Self::ISBD_LINK_STATUS(body) => body.ser(version, bytes),
35998 Self::LANDING_TARGET(body) => body.ser(version, bytes),
35999 Self::LINK_NODE_STATUS(body) => body.ser(version, bytes),
36000 Self::LOCAL_POSITION_NED(body) => body.ser(version, bytes),
36001 Self::LOCAL_POSITION_NED_COV(body) => body.ser(version, bytes),
36002 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(body) => body.ser(version, bytes),
36003 Self::LOGGING_ACK(body) => body.ser(version, bytes),
36004 Self::LOGGING_DATA(body) => body.ser(version, bytes),
36005 Self::LOGGING_DATA_ACKED(body) => body.ser(version, bytes),
36006 Self::LOG_DATA(body) => body.ser(version, bytes),
36007 Self::LOG_ENTRY(body) => body.ser(version, bytes),
36008 Self::LOG_ERASE(body) => body.ser(version, bytes),
36009 Self::LOG_REQUEST_DATA(body) => body.ser(version, bytes),
36010 Self::LOG_REQUEST_END(body) => body.ser(version, bytes),
36011 Self::LOG_REQUEST_LIST(body) => body.ser(version, bytes),
36012 Self::MAG_CAL_REPORT(body) => body.ser(version, bytes),
36013 Self::MANUAL_CONTROL(body) => body.ser(version, bytes),
36014 Self::MANUAL_SETPOINT(body) => body.ser(version, bytes),
36015 Self::MEMORY_VECT(body) => body.ser(version, bytes),
36016 Self::MESSAGE_INTERVAL(body) => body.ser(version, bytes),
36017 Self::MISSION_ACK(body) => body.ser(version, bytes),
36018 Self::MISSION_CLEAR_ALL(body) => body.ser(version, bytes),
36019 Self::MISSION_COUNT(body) => body.ser(version, bytes),
36020 Self::MISSION_CURRENT(body) => body.ser(version, bytes),
36021 Self::MISSION_ITEM(body) => body.ser(version, bytes),
36022 Self::MISSION_ITEM_INT(body) => body.ser(version, bytes),
36023 Self::MISSION_ITEM_REACHED(body) => body.ser(version, bytes),
36024 Self::MISSION_REQUEST(body) => body.ser(version, bytes),
36025 Self::MISSION_REQUEST_INT(body) => body.ser(version, bytes),
36026 Self::MISSION_REQUEST_LIST(body) => body.ser(version, bytes),
36027 Self::MISSION_REQUEST_PARTIAL_LIST(body) => body.ser(version, bytes),
36028 Self::MISSION_SET_CURRENT(body) => body.ser(version, bytes),
36029 Self::MISSION_WRITE_PARTIAL_LIST(body) => body.ser(version, bytes),
36030 Self::MOUNT_ORIENTATION(body) => body.ser(version, bytes),
36031 Self::NAMED_VALUE_FLOAT(body) => body.ser(version, bytes),
36032 Self::NAMED_VALUE_INT(body) => body.ser(version, bytes),
36033 Self::NAV_CONTROLLER_OUTPUT(body) => body.ser(version, bytes),
36034 Self::NAV_FILTER_BIAS(body) => body.ser(version, bytes),
36035 Self::OBSTACLE_DISTANCE(body) => body.ser(version, bytes),
36036 Self::ODOMETRY(body) => body.ser(version, bytes),
36037 Self::ONBOARD_COMPUTER_STATUS(body) => body.ser(version, bytes),
36038 Self::OPEN_DRONE_ID_ARM_STATUS(body) => body.ser(version, bytes),
36039 Self::OPEN_DRONE_ID_AUTHENTICATION(body) => body.ser(version, bytes),
36040 Self::OPEN_DRONE_ID_BASIC_ID(body) => body.ser(version, bytes),
36041 Self::OPEN_DRONE_ID_LOCATION(body) => body.ser(version, bytes),
36042 Self::OPEN_DRONE_ID_MESSAGE_PACK(body) => body.ser(version, bytes),
36043 Self::OPEN_DRONE_ID_OPERATOR_ID(body) => body.ser(version, bytes),
36044 Self::OPEN_DRONE_ID_SELF_ID(body) => body.ser(version, bytes),
36045 Self::OPEN_DRONE_ID_SYSTEM(body) => body.ser(version, bytes),
36046 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(body) => body.ser(version, bytes),
36047 Self::OPTICAL_FLOW(body) => body.ser(version, bytes),
36048 Self::OPTICAL_FLOW_RAD(body) => body.ser(version, bytes),
36049 Self::ORBIT_EXECUTION_STATUS(body) => body.ser(version, bytes),
36050 Self::PARAM_EXT_ACK(body) => body.ser(version, bytes),
36051 Self::PARAM_EXT_REQUEST_LIST(body) => body.ser(version, bytes),
36052 Self::PARAM_EXT_REQUEST_READ(body) => body.ser(version, bytes),
36053 Self::PARAM_EXT_SET(body) => body.ser(version, bytes),
36054 Self::PARAM_EXT_VALUE(body) => body.ser(version, bytes),
36055 Self::PARAM_MAP_RC(body) => body.ser(version, bytes),
36056 Self::PARAM_REQUEST_LIST(body) => body.ser(version, bytes),
36057 Self::PARAM_REQUEST_READ(body) => body.ser(version, bytes),
36058 Self::PARAM_SET(body) => body.ser(version, bytes),
36059 Self::PARAM_VALUE(body) => body.ser(version, bytes),
36060 Self::PING(body) => body.ser(version, bytes),
36061 Self::PLAY_TUNE(body) => body.ser(version, bytes),
36062 Self::PLAY_TUNE_V2(body) => body.ser(version, bytes),
36063 Self::POSITION_TARGET_GLOBAL_INT(body) => body.ser(version, bytes),
36064 Self::POSITION_TARGET_LOCAL_NED(body) => body.ser(version, bytes),
36065 Self::POWER_STATUS(body) => body.ser(version, bytes),
36066 Self::PROTOCOL_VERSION(body) => body.ser(version, bytes),
36067 Self::RADIO_CALIBRATION(body) => body.ser(version, bytes),
36068 Self::RADIO_STATUS(body) => body.ser(version, bytes),
36069 Self::RAW_IMU(body) => body.ser(version, bytes),
36070 Self::RAW_PRESSURE(body) => body.ser(version, bytes),
36071 Self::RAW_RPM(body) => body.ser(version, bytes),
36072 Self::RC_CHANNELS(body) => body.ser(version, bytes),
36073 Self::RC_CHANNELS_OVERRIDE(body) => body.ser(version, bytes),
36074 Self::RC_CHANNELS_RAW(body) => body.ser(version, bytes),
36075 Self::RC_CHANNELS_SCALED(body) => body.ser(version, bytes),
36076 Self::REQUEST_DATA_STREAM(body) => body.ser(version, bytes),
36077 Self::REQUEST_EVENT(body) => body.ser(version, bytes),
36078 Self::RESOURCE_REQUEST(body) => body.ser(version, bytes),
36079 Self::RESPONSE_EVENT_ERROR(body) => body.ser(version, bytes),
36080 Self::SAFETY_ALLOWED_AREA(body) => body.ser(version, bytes),
36081 Self::SAFETY_SET_ALLOWED_AREA(body) => body.ser(version, bytes),
36082 Self::SCALED_IMU(body) => body.ser(version, bytes),
36083 Self::SCALED_IMU2(body) => body.ser(version, bytes),
36084 Self::SCALED_IMU3(body) => body.ser(version, bytes),
36085 Self::SCALED_PRESSURE(body) => body.ser(version, bytes),
36086 Self::SCALED_PRESSURE2(body) => body.ser(version, bytes),
36087 Self::SCALED_PRESSURE3(body) => body.ser(version, bytes),
36088 Self::SERIAL_CONTROL(body) => body.ser(version, bytes),
36089 Self::SERVO_OUTPUT_RAW(body) => body.ser(version, bytes),
36090 Self::SETUP_SIGNING(body) => body.ser(version, bytes),
36091 Self::SET_ACTUATOR_CONTROL_TARGET(body) => body.ser(version, bytes),
36092 Self::SET_ATTITUDE_TARGET(body) => body.ser(version, bytes),
36093 Self::SET_GPS_GLOBAL_ORIGIN(body) => body.ser(version, bytes),
36094 Self::SET_HOME_POSITION(body) => body.ser(version, bytes),
36095 Self::SET_MODE(body) => body.ser(version, bytes),
36096 Self::SET_POSITION_TARGET_GLOBAL_INT(body) => body.ser(version, bytes),
36097 Self::SET_POSITION_TARGET_LOCAL_NED(body) => body.ser(version, bytes),
36098 Self::SIM_STATE(body) => body.ser(version, bytes),
36099 Self::SMART_BATTERY_INFO(body) => body.ser(version, bytes),
36100 Self::STATUSTEXT(body) => body.ser(version, bytes),
36101 Self::STORAGE_INFORMATION(body) => body.ser(version, bytes),
36102 Self::SUPPORTED_TUNES(body) => body.ser(version, bytes),
36103 Self::SYSTEM_TIME(body) => body.ser(version, bytes),
36104 Self::SYS_STATUS(body) => body.ser(version, bytes),
36105 Self::TERRAIN_CHECK(body) => body.ser(version, bytes),
36106 Self::TERRAIN_DATA(body) => body.ser(version, bytes),
36107 Self::TERRAIN_REPORT(body) => body.ser(version, bytes),
36108 Self::TERRAIN_REQUEST(body) => body.ser(version, bytes),
36109 Self::TIMESYNC(body) => body.ser(version, bytes),
36110 Self::TIME_ESTIMATE_TO_TARGET(body) => body.ser(version, bytes),
36111 Self::TRAJECTORY_REPRESENTATION_BEZIER(body) => body.ser(version, bytes),
36112 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(body) => body.ser(version, bytes),
36113 Self::TUNNEL(body) => body.ser(version, bytes),
36114 Self::UALBERTA_SYS_STATUS(body) => body.ser(version, bytes),
36115 Self::UAVCAN_NODE_INFO(body) => body.ser(version, bytes),
36116 Self::UAVCAN_NODE_STATUS(body) => body.ser(version, bytes),
36117 Self::UTM_GLOBAL_POSITION(body) => body.ser(version, bytes),
36118 Self::V2_EXTENSION(body) => body.ser(version, bytes),
36119 Self::VFR_HUD(body) => body.ser(version, bytes),
36120 Self::VIBRATION(body) => body.ser(version, bytes),
36121 Self::VICON_POSITION_ESTIMATE(body) => body.ser(version, bytes),
36122 Self::VIDEO_STREAM_INFORMATION(body) => body.ser(version, bytes),
36123 Self::VIDEO_STREAM_STATUS(body) => body.ser(version, bytes),
36124 Self::VISION_POSITION_ESTIMATE(body) => body.ser(version, bytes),
36125 Self::VISION_SPEED_ESTIMATE(body) => body.ser(version, bytes),
36126 Self::WHEEL_DISTANCE(body) => body.ser(version, bytes),
36127 Self::WIFI_CONFIG_AP(body) => body.ser(version, bytes),
36128 Self::WINCH_STATUS(body) => body.ser(version, bytes),
36129 Self::WIND_COV(body) => body.ser(version, bytes),
36130 }
36131 }
36132 fn extra_crc(id: u32) -> u8 {
36133 match id {
36134 ACTUATOR_CONTROL_TARGET_DATA::ID => ACTUATOR_CONTROL_TARGET_DATA::EXTRA_CRC,
36135 ACTUATOR_OUTPUT_STATUS_DATA::ID => ACTUATOR_OUTPUT_STATUS_DATA::EXTRA_CRC,
36136 ADSB_VEHICLE_DATA::ID => ADSB_VEHICLE_DATA::EXTRA_CRC,
36137 AIS_VESSEL_DATA::ID => AIS_VESSEL_DATA::EXTRA_CRC,
36138 ALTITUDE_DATA::ID => ALTITUDE_DATA::EXTRA_CRC,
36139 ATTITUDE_DATA::ID => ATTITUDE_DATA::EXTRA_CRC,
36140 ATTITUDE_QUATERNION_DATA::ID => ATTITUDE_QUATERNION_DATA::EXTRA_CRC,
36141 ATTITUDE_QUATERNION_COV_DATA::ID => ATTITUDE_QUATERNION_COV_DATA::EXTRA_CRC,
36142 ATTITUDE_TARGET_DATA::ID => ATTITUDE_TARGET_DATA::EXTRA_CRC,
36143 ATT_POS_MOCAP_DATA::ID => ATT_POS_MOCAP_DATA::EXTRA_CRC,
36144 AUTH_KEY_DATA::ID => AUTH_KEY_DATA::EXTRA_CRC,
36145 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
36146 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::EXTRA_CRC
36147 }
36148 AUTOPILOT_VERSION_DATA::ID => AUTOPILOT_VERSION_DATA::EXTRA_CRC,
36149 AVAILABLE_MODES_DATA::ID => AVAILABLE_MODES_DATA::EXTRA_CRC,
36150 AVAILABLE_MODES_MONITOR_DATA::ID => AVAILABLE_MODES_MONITOR_DATA::EXTRA_CRC,
36151 BATTERY_INFO_DATA::ID => BATTERY_INFO_DATA::EXTRA_CRC,
36152 BATTERY_STATUS_DATA::ID => BATTERY_STATUS_DATA::EXTRA_CRC,
36153 BUTTON_CHANGE_DATA::ID => BUTTON_CHANGE_DATA::EXTRA_CRC,
36154 CAMERA_CAPTURE_STATUS_DATA::ID => CAMERA_CAPTURE_STATUS_DATA::EXTRA_CRC,
36155 CAMERA_FOV_STATUS_DATA::ID => CAMERA_FOV_STATUS_DATA::EXTRA_CRC,
36156 CAMERA_IMAGE_CAPTURED_DATA::ID => CAMERA_IMAGE_CAPTURED_DATA::EXTRA_CRC,
36157 CAMERA_INFORMATION_DATA::ID => CAMERA_INFORMATION_DATA::EXTRA_CRC,
36158 CAMERA_SETTINGS_DATA::ID => CAMERA_SETTINGS_DATA::EXTRA_CRC,
36159 CAMERA_THERMAL_RANGE_DATA::ID => CAMERA_THERMAL_RANGE_DATA::EXTRA_CRC,
36160 CAMERA_TRACKING_GEO_STATUS_DATA::ID => CAMERA_TRACKING_GEO_STATUS_DATA::EXTRA_CRC,
36161 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => CAMERA_TRACKING_IMAGE_STATUS_DATA::EXTRA_CRC,
36162 CAMERA_TRIGGER_DATA::ID => CAMERA_TRIGGER_DATA::EXTRA_CRC,
36163 CANFD_FRAME_DATA::ID => CANFD_FRAME_DATA::EXTRA_CRC,
36164 CAN_FILTER_MODIFY_DATA::ID => CAN_FILTER_MODIFY_DATA::EXTRA_CRC,
36165 CAN_FRAME_DATA::ID => CAN_FRAME_DATA::EXTRA_CRC,
36166 CELLULAR_CONFIG_DATA::ID => CELLULAR_CONFIG_DATA::EXTRA_CRC,
36167 CELLULAR_STATUS_DATA::ID => CELLULAR_STATUS_DATA::EXTRA_CRC,
36168 CHANGE_OPERATOR_CONTROL_DATA::ID => CHANGE_OPERATOR_CONTROL_DATA::EXTRA_CRC,
36169 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => CHANGE_OPERATOR_CONTROL_ACK_DATA::EXTRA_CRC,
36170 COLLISION_DATA::ID => COLLISION_DATA::EXTRA_CRC,
36171 COMMAND_ACK_DATA::ID => COMMAND_ACK_DATA::EXTRA_CRC,
36172 COMMAND_CANCEL_DATA::ID => COMMAND_CANCEL_DATA::EXTRA_CRC,
36173 COMMAND_INT_DATA::ID => COMMAND_INT_DATA::EXTRA_CRC,
36174 COMMAND_LONG_DATA::ID => COMMAND_LONG_DATA::EXTRA_CRC,
36175 COMPONENT_INFORMATION_DATA::ID => COMPONENT_INFORMATION_DATA::EXTRA_CRC,
36176 COMPONENT_INFORMATION_BASIC_DATA::ID => COMPONENT_INFORMATION_BASIC_DATA::EXTRA_CRC,
36177 COMPONENT_METADATA_DATA::ID => COMPONENT_METADATA_DATA::EXTRA_CRC,
36178 CONTROL_SYSTEM_STATE_DATA::ID => CONTROL_SYSTEM_STATE_DATA::EXTRA_CRC,
36179 CURRENT_EVENT_SEQUENCE_DATA::ID => CURRENT_EVENT_SEQUENCE_DATA::EXTRA_CRC,
36180 CURRENT_MODE_DATA::ID => CURRENT_MODE_DATA::EXTRA_CRC,
36181 DATA_STREAM_DATA::ID => DATA_STREAM_DATA::EXTRA_CRC,
36182 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => DATA_TRANSMISSION_HANDSHAKE_DATA::EXTRA_CRC,
36183 DEBUG_DATA::ID => DEBUG_DATA::EXTRA_CRC,
36184 DEBUG_FLOAT_ARRAY_DATA::ID => DEBUG_FLOAT_ARRAY_DATA::EXTRA_CRC,
36185 DEBUG_VECT_DATA::ID => DEBUG_VECT_DATA::EXTRA_CRC,
36186 DISTANCE_SENSOR_DATA::ID => DISTANCE_SENSOR_DATA::EXTRA_CRC,
36187 EFI_STATUS_DATA::ID => EFI_STATUS_DATA::EXTRA_CRC,
36188 ENCAPSULATED_DATA_DATA::ID => ENCAPSULATED_DATA_DATA::EXTRA_CRC,
36189 ESC_INFO_DATA::ID => ESC_INFO_DATA::EXTRA_CRC,
36190 ESC_STATUS_DATA::ID => ESC_STATUS_DATA::EXTRA_CRC,
36191 ESTIMATOR_STATUS_DATA::ID => ESTIMATOR_STATUS_DATA::EXTRA_CRC,
36192 EVENT_DATA::ID => EVENT_DATA::EXTRA_CRC,
36193 EXTENDED_SYS_STATE_DATA::ID => EXTENDED_SYS_STATE_DATA::EXTRA_CRC,
36194 FENCE_STATUS_DATA::ID => FENCE_STATUS_DATA::EXTRA_CRC,
36195 FILE_TRANSFER_PROTOCOL_DATA::ID => FILE_TRANSFER_PROTOCOL_DATA::EXTRA_CRC,
36196 FLIGHT_INFORMATION_DATA::ID => FLIGHT_INFORMATION_DATA::EXTRA_CRC,
36197 FOLLOW_TARGET_DATA::ID => FOLLOW_TARGET_DATA::EXTRA_CRC,
36198 FUEL_STATUS_DATA::ID => FUEL_STATUS_DATA::EXTRA_CRC,
36199 GENERATOR_STATUS_DATA::ID => GENERATOR_STATUS_DATA::EXTRA_CRC,
36200 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::EXTRA_CRC,
36201 GIMBAL_DEVICE_INFORMATION_DATA::ID => GIMBAL_DEVICE_INFORMATION_DATA::EXTRA_CRC,
36202 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => GIMBAL_DEVICE_SET_ATTITUDE_DATA::EXTRA_CRC,
36203 GIMBAL_MANAGER_INFORMATION_DATA::ID => GIMBAL_MANAGER_INFORMATION_DATA::EXTRA_CRC,
36204 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => GIMBAL_MANAGER_SET_ATTITUDE_DATA::EXTRA_CRC,
36205 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
36206 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::EXTRA_CRC
36207 }
36208 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => GIMBAL_MANAGER_SET_PITCHYAW_DATA::EXTRA_CRC,
36209 GIMBAL_MANAGER_STATUS_DATA::ID => GIMBAL_MANAGER_STATUS_DATA::EXTRA_CRC,
36210 GLOBAL_POSITION_INT_DATA::ID => GLOBAL_POSITION_INT_DATA::EXTRA_CRC,
36211 GLOBAL_POSITION_INT_COV_DATA::ID => GLOBAL_POSITION_INT_COV_DATA::EXTRA_CRC,
36212 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
36213 GLOBAL_VISION_POSITION_ESTIMATE_DATA::EXTRA_CRC
36214 }
36215 GPS2_RAW_DATA::ID => GPS2_RAW_DATA::EXTRA_CRC,
36216 GPS2_RTK_DATA::ID => GPS2_RTK_DATA::EXTRA_CRC,
36217 GPS_GLOBAL_ORIGIN_DATA::ID => GPS_GLOBAL_ORIGIN_DATA::EXTRA_CRC,
36218 GPS_INJECT_DATA_DATA::ID => GPS_INJECT_DATA_DATA::EXTRA_CRC,
36219 GPS_INPUT_DATA::ID => GPS_INPUT_DATA::EXTRA_CRC,
36220 GPS_RAW_INT_DATA::ID => GPS_RAW_INT_DATA::EXTRA_CRC,
36221 GPS_RTCM_DATA_DATA::ID => GPS_RTCM_DATA_DATA::EXTRA_CRC,
36222 GPS_RTK_DATA::ID => GPS_RTK_DATA::EXTRA_CRC,
36223 GPS_STATUS_DATA::ID => GPS_STATUS_DATA::EXTRA_CRC,
36224 HEARTBEAT_DATA::ID => HEARTBEAT_DATA::EXTRA_CRC,
36225 HIGHRES_IMU_DATA::ID => HIGHRES_IMU_DATA::EXTRA_CRC,
36226 HIGH_LATENCY_DATA::ID => HIGH_LATENCY_DATA::EXTRA_CRC,
36227 HIGH_LATENCY2_DATA::ID => HIGH_LATENCY2_DATA::EXTRA_CRC,
36228 HIL_ACTUATOR_CONTROLS_DATA::ID => HIL_ACTUATOR_CONTROLS_DATA::EXTRA_CRC,
36229 HIL_CONTROLS_DATA::ID => HIL_CONTROLS_DATA::EXTRA_CRC,
36230 HIL_GPS_DATA::ID => HIL_GPS_DATA::EXTRA_CRC,
36231 HIL_OPTICAL_FLOW_DATA::ID => HIL_OPTICAL_FLOW_DATA::EXTRA_CRC,
36232 HIL_RC_INPUTS_RAW_DATA::ID => HIL_RC_INPUTS_RAW_DATA::EXTRA_CRC,
36233 HIL_SENSOR_DATA::ID => HIL_SENSOR_DATA::EXTRA_CRC,
36234 HIL_STATE_DATA::ID => HIL_STATE_DATA::EXTRA_CRC,
36235 HIL_STATE_QUATERNION_DATA::ID => HIL_STATE_QUATERNION_DATA::EXTRA_CRC,
36236 HOME_POSITION_DATA::ID => HOME_POSITION_DATA::EXTRA_CRC,
36237 HYGROMETER_SENSOR_DATA::ID => HYGROMETER_SENSOR_DATA::EXTRA_CRC,
36238 ILLUMINATOR_STATUS_DATA::ID => ILLUMINATOR_STATUS_DATA::EXTRA_CRC,
36239 ISBD_LINK_STATUS_DATA::ID => ISBD_LINK_STATUS_DATA::EXTRA_CRC,
36240 LANDING_TARGET_DATA::ID => LANDING_TARGET_DATA::EXTRA_CRC,
36241 LINK_NODE_STATUS_DATA::ID => LINK_NODE_STATUS_DATA::EXTRA_CRC,
36242 LOCAL_POSITION_NED_DATA::ID => LOCAL_POSITION_NED_DATA::EXTRA_CRC,
36243 LOCAL_POSITION_NED_COV_DATA::ID => LOCAL_POSITION_NED_COV_DATA::EXTRA_CRC,
36244 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
36245 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::EXTRA_CRC
36246 }
36247 LOGGING_ACK_DATA::ID => LOGGING_ACK_DATA::EXTRA_CRC,
36248 LOGGING_DATA_DATA::ID => LOGGING_DATA_DATA::EXTRA_CRC,
36249 LOGGING_DATA_ACKED_DATA::ID => LOGGING_DATA_ACKED_DATA::EXTRA_CRC,
36250 LOG_DATA_DATA::ID => LOG_DATA_DATA::EXTRA_CRC,
36251 LOG_ENTRY_DATA::ID => LOG_ENTRY_DATA::EXTRA_CRC,
36252 LOG_ERASE_DATA::ID => LOG_ERASE_DATA::EXTRA_CRC,
36253 LOG_REQUEST_DATA_DATA::ID => LOG_REQUEST_DATA_DATA::EXTRA_CRC,
36254 LOG_REQUEST_END_DATA::ID => LOG_REQUEST_END_DATA::EXTRA_CRC,
36255 LOG_REQUEST_LIST_DATA::ID => LOG_REQUEST_LIST_DATA::EXTRA_CRC,
36256 MAG_CAL_REPORT_DATA::ID => MAG_CAL_REPORT_DATA::EXTRA_CRC,
36257 MANUAL_CONTROL_DATA::ID => MANUAL_CONTROL_DATA::EXTRA_CRC,
36258 MANUAL_SETPOINT_DATA::ID => MANUAL_SETPOINT_DATA::EXTRA_CRC,
36259 MEMORY_VECT_DATA::ID => MEMORY_VECT_DATA::EXTRA_CRC,
36260 MESSAGE_INTERVAL_DATA::ID => MESSAGE_INTERVAL_DATA::EXTRA_CRC,
36261 MISSION_ACK_DATA::ID => MISSION_ACK_DATA::EXTRA_CRC,
36262 MISSION_CLEAR_ALL_DATA::ID => MISSION_CLEAR_ALL_DATA::EXTRA_CRC,
36263 MISSION_COUNT_DATA::ID => MISSION_COUNT_DATA::EXTRA_CRC,
36264 MISSION_CURRENT_DATA::ID => MISSION_CURRENT_DATA::EXTRA_CRC,
36265 MISSION_ITEM_DATA::ID => MISSION_ITEM_DATA::EXTRA_CRC,
36266 MISSION_ITEM_INT_DATA::ID => MISSION_ITEM_INT_DATA::EXTRA_CRC,
36267 MISSION_ITEM_REACHED_DATA::ID => MISSION_ITEM_REACHED_DATA::EXTRA_CRC,
36268 MISSION_REQUEST_DATA::ID => MISSION_REQUEST_DATA::EXTRA_CRC,
36269 MISSION_REQUEST_INT_DATA::ID => MISSION_REQUEST_INT_DATA::EXTRA_CRC,
36270 MISSION_REQUEST_LIST_DATA::ID => MISSION_REQUEST_LIST_DATA::EXTRA_CRC,
36271 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => MISSION_REQUEST_PARTIAL_LIST_DATA::EXTRA_CRC,
36272 MISSION_SET_CURRENT_DATA::ID => MISSION_SET_CURRENT_DATA::EXTRA_CRC,
36273 MISSION_WRITE_PARTIAL_LIST_DATA::ID => MISSION_WRITE_PARTIAL_LIST_DATA::EXTRA_CRC,
36274 MOUNT_ORIENTATION_DATA::ID => MOUNT_ORIENTATION_DATA::EXTRA_CRC,
36275 NAMED_VALUE_FLOAT_DATA::ID => NAMED_VALUE_FLOAT_DATA::EXTRA_CRC,
36276 NAMED_VALUE_INT_DATA::ID => NAMED_VALUE_INT_DATA::EXTRA_CRC,
36277 NAV_CONTROLLER_OUTPUT_DATA::ID => NAV_CONTROLLER_OUTPUT_DATA::EXTRA_CRC,
36278 NAV_FILTER_BIAS_DATA::ID => NAV_FILTER_BIAS_DATA::EXTRA_CRC,
36279 OBSTACLE_DISTANCE_DATA::ID => OBSTACLE_DISTANCE_DATA::EXTRA_CRC,
36280 ODOMETRY_DATA::ID => ODOMETRY_DATA::EXTRA_CRC,
36281 ONBOARD_COMPUTER_STATUS_DATA::ID => ONBOARD_COMPUTER_STATUS_DATA::EXTRA_CRC,
36282 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => OPEN_DRONE_ID_ARM_STATUS_DATA::EXTRA_CRC,
36283 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => OPEN_DRONE_ID_AUTHENTICATION_DATA::EXTRA_CRC,
36284 OPEN_DRONE_ID_BASIC_ID_DATA::ID => OPEN_DRONE_ID_BASIC_ID_DATA::EXTRA_CRC,
36285 OPEN_DRONE_ID_LOCATION_DATA::ID => OPEN_DRONE_ID_LOCATION_DATA::EXTRA_CRC,
36286 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => OPEN_DRONE_ID_MESSAGE_PACK_DATA::EXTRA_CRC,
36287 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => OPEN_DRONE_ID_OPERATOR_ID_DATA::EXTRA_CRC,
36288 OPEN_DRONE_ID_SELF_ID_DATA::ID => OPEN_DRONE_ID_SELF_ID_DATA::EXTRA_CRC,
36289 OPEN_DRONE_ID_SYSTEM_DATA::ID => OPEN_DRONE_ID_SYSTEM_DATA::EXTRA_CRC,
36290 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::EXTRA_CRC,
36291 OPTICAL_FLOW_DATA::ID => OPTICAL_FLOW_DATA::EXTRA_CRC,
36292 OPTICAL_FLOW_RAD_DATA::ID => OPTICAL_FLOW_RAD_DATA::EXTRA_CRC,
36293 ORBIT_EXECUTION_STATUS_DATA::ID => ORBIT_EXECUTION_STATUS_DATA::EXTRA_CRC,
36294 PARAM_EXT_ACK_DATA::ID => PARAM_EXT_ACK_DATA::EXTRA_CRC,
36295 PARAM_EXT_REQUEST_LIST_DATA::ID => PARAM_EXT_REQUEST_LIST_DATA::EXTRA_CRC,
36296 PARAM_EXT_REQUEST_READ_DATA::ID => PARAM_EXT_REQUEST_READ_DATA::EXTRA_CRC,
36297 PARAM_EXT_SET_DATA::ID => PARAM_EXT_SET_DATA::EXTRA_CRC,
36298 PARAM_EXT_VALUE_DATA::ID => PARAM_EXT_VALUE_DATA::EXTRA_CRC,
36299 PARAM_MAP_RC_DATA::ID => PARAM_MAP_RC_DATA::EXTRA_CRC,
36300 PARAM_REQUEST_LIST_DATA::ID => PARAM_REQUEST_LIST_DATA::EXTRA_CRC,
36301 PARAM_REQUEST_READ_DATA::ID => PARAM_REQUEST_READ_DATA::EXTRA_CRC,
36302 PARAM_SET_DATA::ID => PARAM_SET_DATA::EXTRA_CRC,
36303 PARAM_VALUE_DATA::ID => PARAM_VALUE_DATA::EXTRA_CRC,
36304 PING_DATA::ID => PING_DATA::EXTRA_CRC,
36305 PLAY_TUNE_DATA::ID => PLAY_TUNE_DATA::EXTRA_CRC,
36306 PLAY_TUNE_V2_DATA::ID => PLAY_TUNE_V2_DATA::EXTRA_CRC,
36307 POSITION_TARGET_GLOBAL_INT_DATA::ID => POSITION_TARGET_GLOBAL_INT_DATA::EXTRA_CRC,
36308 POSITION_TARGET_LOCAL_NED_DATA::ID => POSITION_TARGET_LOCAL_NED_DATA::EXTRA_CRC,
36309 POWER_STATUS_DATA::ID => POWER_STATUS_DATA::EXTRA_CRC,
36310 PROTOCOL_VERSION_DATA::ID => PROTOCOL_VERSION_DATA::EXTRA_CRC,
36311 RADIO_CALIBRATION_DATA::ID => RADIO_CALIBRATION_DATA::EXTRA_CRC,
36312 RADIO_STATUS_DATA::ID => RADIO_STATUS_DATA::EXTRA_CRC,
36313 RAW_IMU_DATA::ID => RAW_IMU_DATA::EXTRA_CRC,
36314 RAW_PRESSURE_DATA::ID => RAW_PRESSURE_DATA::EXTRA_CRC,
36315 RAW_RPM_DATA::ID => RAW_RPM_DATA::EXTRA_CRC,
36316 RC_CHANNELS_DATA::ID => RC_CHANNELS_DATA::EXTRA_CRC,
36317 RC_CHANNELS_OVERRIDE_DATA::ID => RC_CHANNELS_OVERRIDE_DATA::EXTRA_CRC,
36318 RC_CHANNELS_RAW_DATA::ID => RC_CHANNELS_RAW_DATA::EXTRA_CRC,
36319 RC_CHANNELS_SCALED_DATA::ID => RC_CHANNELS_SCALED_DATA::EXTRA_CRC,
36320 REQUEST_DATA_STREAM_DATA::ID => REQUEST_DATA_STREAM_DATA::EXTRA_CRC,
36321 REQUEST_EVENT_DATA::ID => REQUEST_EVENT_DATA::EXTRA_CRC,
36322 RESOURCE_REQUEST_DATA::ID => RESOURCE_REQUEST_DATA::EXTRA_CRC,
36323 RESPONSE_EVENT_ERROR_DATA::ID => RESPONSE_EVENT_ERROR_DATA::EXTRA_CRC,
36324 SAFETY_ALLOWED_AREA_DATA::ID => SAFETY_ALLOWED_AREA_DATA::EXTRA_CRC,
36325 SAFETY_SET_ALLOWED_AREA_DATA::ID => SAFETY_SET_ALLOWED_AREA_DATA::EXTRA_CRC,
36326 SCALED_IMU_DATA::ID => SCALED_IMU_DATA::EXTRA_CRC,
36327 SCALED_IMU2_DATA::ID => SCALED_IMU2_DATA::EXTRA_CRC,
36328 SCALED_IMU3_DATA::ID => SCALED_IMU3_DATA::EXTRA_CRC,
36329 SCALED_PRESSURE_DATA::ID => SCALED_PRESSURE_DATA::EXTRA_CRC,
36330 SCALED_PRESSURE2_DATA::ID => SCALED_PRESSURE2_DATA::EXTRA_CRC,
36331 SCALED_PRESSURE3_DATA::ID => SCALED_PRESSURE3_DATA::EXTRA_CRC,
36332 SERIAL_CONTROL_DATA::ID => SERIAL_CONTROL_DATA::EXTRA_CRC,
36333 SERVO_OUTPUT_RAW_DATA::ID => SERVO_OUTPUT_RAW_DATA::EXTRA_CRC,
36334 SETUP_SIGNING_DATA::ID => SETUP_SIGNING_DATA::EXTRA_CRC,
36335 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => SET_ACTUATOR_CONTROL_TARGET_DATA::EXTRA_CRC,
36336 SET_ATTITUDE_TARGET_DATA::ID => SET_ATTITUDE_TARGET_DATA::EXTRA_CRC,
36337 SET_GPS_GLOBAL_ORIGIN_DATA::ID => SET_GPS_GLOBAL_ORIGIN_DATA::EXTRA_CRC,
36338 SET_HOME_POSITION_DATA::ID => SET_HOME_POSITION_DATA::EXTRA_CRC,
36339 SET_MODE_DATA::ID => SET_MODE_DATA::EXTRA_CRC,
36340 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => {
36341 SET_POSITION_TARGET_GLOBAL_INT_DATA::EXTRA_CRC
36342 }
36343 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => SET_POSITION_TARGET_LOCAL_NED_DATA::EXTRA_CRC,
36344 SIM_STATE_DATA::ID => SIM_STATE_DATA::EXTRA_CRC,
36345 SMART_BATTERY_INFO_DATA::ID => SMART_BATTERY_INFO_DATA::EXTRA_CRC,
36346 STATUSTEXT_DATA::ID => STATUSTEXT_DATA::EXTRA_CRC,
36347 STORAGE_INFORMATION_DATA::ID => STORAGE_INFORMATION_DATA::EXTRA_CRC,
36348 SUPPORTED_TUNES_DATA::ID => SUPPORTED_TUNES_DATA::EXTRA_CRC,
36349 SYSTEM_TIME_DATA::ID => SYSTEM_TIME_DATA::EXTRA_CRC,
36350 SYS_STATUS_DATA::ID => SYS_STATUS_DATA::EXTRA_CRC,
36351 TERRAIN_CHECK_DATA::ID => TERRAIN_CHECK_DATA::EXTRA_CRC,
36352 TERRAIN_DATA_DATA::ID => TERRAIN_DATA_DATA::EXTRA_CRC,
36353 TERRAIN_REPORT_DATA::ID => TERRAIN_REPORT_DATA::EXTRA_CRC,
36354 TERRAIN_REQUEST_DATA::ID => TERRAIN_REQUEST_DATA::EXTRA_CRC,
36355 TIMESYNC_DATA::ID => TIMESYNC_DATA::EXTRA_CRC,
36356 TIME_ESTIMATE_TO_TARGET_DATA::ID => TIME_ESTIMATE_TO_TARGET_DATA::EXTRA_CRC,
36357 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
36358 TRAJECTORY_REPRESENTATION_BEZIER_DATA::EXTRA_CRC
36359 }
36360 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
36361 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::EXTRA_CRC
36362 }
36363 TUNNEL_DATA::ID => TUNNEL_DATA::EXTRA_CRC,
36364 UALBERTA_SYS_STATUS_DATA::ID => UALBERTA_SYS_STATUS_DATA::EXTRA_CRC,
36365 UAVCAN_NODE_INFO_DATA::ID => UAVCAN_NODE_INFO_DATA::EXTRA_CRC,
36366 UAVCAN_NODE_STATUS_DATA::ID => UAVCAN_NODE_STATUS_DATA::EXTRA_CRC,
36367 UTM_GLOBAL_POSITION_DATA::ID => UTM_GLOBAL_POSITION_DATA::EXTRA_CRC,
36368 V2_EXTENSION_DATA::ID => V2_EXTENSION_DATA::EXTRA_CRC,
36369 VFR_HUD_DATA::ID => VFR_HUD_DATA::EXTRA_CRC,
36370 VIBRATION_DATA::ID => VIBRATION_DATA::EXTRA_CRC,
36371 VICON_POSITION_ESTIMATE_DATA::ID => VICON_POSITION_ESTIMATE_DATA::EXTRA_CRC,
36372 VIDEO_STREAM_INFORMATION_DATA::ID => VIDEO_STREAM_INFORMATION_DATA::EXTRA_CRC,
36373 VIDEO_STREAM_STATUS_DATA::ID => VIDEO_STREAM_STATUS_DATA::EXTRA_CRC,
36374 VISION_POSITION_ESTIMATE_DATA::ID => VISION_POSITION_ESTIMATE_DATA::EXTRA_CRC,
36375 VISION_SPEED_ESTIMATE_DATA::ID => VISION_SPEED_ESTIMATE_DATA::EXTRA_CRC,
36376 WHEEL_DISTANCE_DATA::ID => WHEEL_DISTANCE_DATA::EXTRA_CRC,
36377 WIFI_CONFIG_AP_DATA::ID => WIFI_CONFIG_AP_DATA::EXTRA_CRC,
36378 WINCH_STATUS_DATA::ID => WINCH_STATUS_DATA::EXTRA_CRC,
36379 WIND_COV_DATA::ID => WIND_COV_DATA::EXTRA_CRC,
36380 _ => 0,
36381 }
36382 }
36383 fn target_system_id(&self) -> Option<u8> {
36384 match self {
36385 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(inner) => Some(inner.target_system),
36386 Self::CANFD_FRAME(inner) => Some(inner.target_system),
36387 Self::CAN_FILTER_MODIFY(inner) => Some(inner.target_system),
36388 Self::CAN_FRAME(inner) => Some(inner.target_system),
36389 Self::CHANGE_OPERATOR_CONTROL(inner) => Some(inner.target_system),
36390 Self::COMMAND_ACK(inner) => Some(inner.target_system),
36391 Self::COMMAND_CANCEL(inner) => Some(inner.target_system),
36392 Self::COMMAND_INT(inner) => Some(inner.target_system),
36393 Self::COMMAND_LONG(inner) => Some(inner.target_system),
36394 Self::FILE_TRANSFER_PROTOCOL(inner) => Some(inner.target_system),
36395 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(inner) => Some(inner.target_system),
36396 Self::GIMBAL_DEVICE_SET_ATTITUDE(inner) => Some(inner.target_system),
36397 Self::GIMBAL_MANAGER_SET_ATTITUDE(inner) => Some(inner.target_system),
36398 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(inner) => Some(inner.target_system),
36399 Self::GIMBAL_MANAGER_SET_PITCHYAW(inner) => Some(inner.target_system),
36400 Self::GPS_INJECT_DATA(inner) => Some(inner.target_system),
36401 Self::LOGGING_ACK(inner) => Some(inner.target_system),
36402 Self::LOGGING_DATA(inner) => Some(inner.target_system),
36403 Self::LOGGING_DATA_ACKED(inner) => Some(inner.target_system),
36404 Self::LOG_ERASE(inner) => Some(inner.target_system),
36405 Self::LOG_REQUEST_DATA(inner) => Some(inner.target_system),
36406 Self::LOG_REQUEST_END(inner) => Some(inner.target_system),
36407 Self::LOG_REQUEST_LIST(inner) => Some(inner.target_system),
36408 Self::MISSION_ACK(inner) => Some(inner.target_system),
36409 Self::MISSION_CLEAR_ALL(inner) => Some(inner.target_system),
36410 Self::MISSION_COUNT(inner) => Some(inner.target_system),
36411 Self::MISSION_ITEM(inner) => Some(inner.target_system),
36412 Self::MISSION_ITEM_INT(inner) => Some(inner.target_system),
36413 Self::MISSION_REQUEST(inner) => Some(inner.target_system),
36414 Self::MISSION_REQUEST_INT(inner) => Some(inner.target_system),
36415 Self::MISSION_REQUEST_LIST(inner) => Some(inner.target_system),
36416 Self::MISSION_REQUEST_PARTIAL_LIST(inner) => Some(inner.target_system),
36417 Self::MISSION_SET_CURRENT(inner) => Some(inner.target_system),
36418 Self::MISSION_WRITE_PARTIAL_LIST(inner) => Some(inner.target_system),
36419 Self::OPEN_DRONE_ID_AUTHENTICATION(inner) => Some(inner.target_system),
36420 Self::OPEN_DRONE_ID_BASIC_ID(inner) => Some(inner.target_system),
36421 Self::OPEN_DRONE_ID_LOCATION(inner) => Some(inner.target_system),
36422 Self::OPEN_DRONE_ID_MESSAGE_PACK(inner) => Some(inner.target_system),
36423 Self::OPEN_DRONE_ID_OPERATOR_ID(inner) => Some(inner.target_system),
36424 Self::OPEN_DRONE_ID_SELF_ID(inner) => Some(inner.target_system),
36425 Self::OPEN_DRONE_ID_SYSTEM(inner) => Some(inner.target_system),
36426 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(inner) => Some(inner.target_system),
36427 Self::PARAM_EXT_REQUEST_LIST(inner) => Some(inner.target_system),
36428 Self::PARAM_EXT_REQUEST_READ(inner) => Some(inner.target_system),
36429 Self::PARAM_EXT_SET(inner) => Some(inner.target_system),
36430 Self::PARAM_MAP_RC(inner) => Some(inner.target_system),
36431 Self::PARAM_REQUEST_LIST(inner) => Some(inner.target_system),
36432 Self::PARAM_REQUEST_READ(inner) => Some(inner.target_system),
36433 Self::PARAM_SET(inner) => Some(inner.target_system),
36434 Self::PING(inner) => Some(inner.target_system),
36435 Self::PLAY_TUNE(inner) => Some(inner.target_system),
36436 Self::PLAY_TUNE_V2(inner) => Some(inner.target_system),
36437 Self::RC_CHANNELS_OVERRIDE(inner) => Some(inner.target_system),
36438 Self::REQUEST_DATA_STREAM(inner) => Some(inner.target_system),
36439 Self::REQUEST_EVENT(inner) => Some(inner.target_system),
36440 Self::RESPONSE_EVENT_ERROR(inner) => Some(inner.target_system),
36441 Self::SAFETY_SET_ALLOWED_AREA(inner) => Some(inner.target_system),
36442 Self::SERIAL_CONTROL(inner) => Some(inner.target_system),
36443 Self::SETUP_SIGNING(inner) => Some(inner.target_system),
36444 Self::SET_ACTUATOR_CONTROL_TARGET(inner) => Some(inner.target_system),
36445 Self::SET_ATTITUDE_TARGET(inner) => Some(inner.target_system),
36446 Self::SET_GPS_GLOBAL_ORIGIN(inner) => Some(inner.target_system),
36447 Self::SET_HOME_POSITION(inner) => Some(inner.target_system),
36448 Self::SET_MODE(inner) => Some(inner.target_system),
36449 Self::SET_POSITION_TARGET_GLOBAL_INT(inner) => Some(inner.target_system),
36450 Self::SET_POSITION_TARGET_LOCAL_NED(inner) => Some(inner.target_system),
36451 Self::SUPPORTED_TUNES(inner) => Some(inner.target_system),
36452 Self::TIMESYNC(inner) => Some(inner.target_system),
36453 Self::TUNNEL(inner) => Some(inner.target_system),
36454 Self::V2_EXTENSION(inner) => Some(inner.target_system),
36455 _ => None,
36456 }
36457 }
36458 fn target_component_id(&self) -> Option<u8> {
36459 match self {
36460 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(inner) => Some(inner.target_component),
36461 Self::CANFD_FRAME(inner) => Some(inner.target_component),
36462 Self::CAN_FILTER_MODIFY(inner) => Some(inner.target_component),
36463 Self::CAN_FRAME(inner) => Some(inner.target_component),
36464 Self::COMMAND_ACK(inner) => Some(inner.target_component),
36465 Self::COMMAND_CANCEL(inner) => Some(inner.target_component),
36466 Self::COMMAND_INT(inner) => Some(inner.target_component),
36467 Self::COMMAND_LONG(inner) => Some(inner.target_component),
36468 Self::FILE_TRANSFER_PROTOCOL(inner) => Some(inner.target_component),
36469 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(inner) => Some(inner.target_component),
36470 Self::GIMBAL_DEVICE_SET_ATTITUDE(inner) => Some(inner.target_component),
36471 Self::GIMBAL_MANAGER_SET_ATTITUDE(inner) => Some(inner.target_component),
36472 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(inner) => Some(inner.target_component),
36473 Self::GIMBAL_MANAGER_SET_PITCHYAW(inner) => Some(inner.target_component),
36474 Self::GPS_INJECT_DATA(inner) => Some(inner.target_component),
36475 Self::LOGGING_ACK(inner) => Some(inner.target_component),
36476 Self::LOGGING_DATA(inner) => Some(inner.target_component),
36477 Self::LOGGING_DATA_ACKED(inner) => Some(inner.target_component),
36478 Self::LOG_ERASE(inner) => Some(inner.target_component),
36479 Self::LOG_REQUEST_DATA(inner) => Some(inner.target_component),
36480 Self::LOG_REQUEST_END(inner) => Some(inner.target_component),
36481 Self::LOG_REQUEST_LIST(inner) => Some(inner.target_component),
36482 Self::MISSION_ACK(inner) => Some(inner.target_component),
36483 Self::MISSION_CLEAR_ALL(inner) => Some(inner.target_component),
36484 Self::MISSION_COUNT(inner) => Some(inner.target_component),
36485 Self::MISSION_ITEM(inner) => Some(inner.target_component),
36486 Self::MISSION_ITEM_INT(inner) => Some(inner.target_component),
36487 Self::MISSION_REQUEST(inner) => Some(inner.target_component),
36488 Self::MISSION_REQUEST_INT(inner) => Some(inner.target_component),
36489 Self::MISSION_REQUEST_LIST(inner) => Some(inner.target_component),
36490 Self::MISSION_REQUEST_PARTIAL_LIST(inner) => Some(inner.target_component),
36491 Self::MISSION_SET_CURRENT(inner) => Some(inner.target_component),
36492 Self::MISSION_WRITE_PARTIAL_LIST(inner) => Some(inner.target_component),
36493 Self::OPEN_DRONE_ID_AUTHENTICATION(inner) => Some(inner.target_component),
36494 Self::OPEN_DRONE_ID_BASIC_ID(inner) => Some(inner.target_component),
36495 Self::OPEN_DRONE_ID_LOCATION(inner) => Some(inner.target_component),
36496 Self::OPEN_DRONE_ID_MESSAGE_PACK(inner) => Some(inner.target_component),
36497 Self::OPEN_DRONE_ID_OPERATOR_ID(inner) => Some(inner.target_component),
36498 Self::OPEN_DRONE_ID_SELF_ID(inner) => Some(inner.target_component),
36499 Self::OPEN_DRONE_ID_SYSTEM(inner) => Some(inner.target_component),
36500 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(inner) => Some(inner.target_component),
36501 Self::PARAM_EXT_REQUEST_LIST(inner) => Some(inner.target_component),
36502 Self::PARAM_EXT_REQUEST_READ(inner) => Some(inner.target_component),
36503 Self::PARAM_EXT_SET(inner) => Some(inner.target_component),
36504 Self::PARAM_MAP_RC(inner) => Some(inner.target_component),
36505 Self::PARAM_REQUEST_LIST(inner) => Some(inner.target_component),
36506 Self::PARAM_REQUEST_READ(inner) => Some(inner.target_component),
36507 Self::PARAM_SET(inner) => Some(inner.target_component),
36508 Self::PING(inner) => Some(inner.target_component),
36509 Self::PLAY_TUNE(inner) => Some(inner.target_component),
36510 Self::PLAY_TUNE_V2(inner) => Some(inner.target_component),
36511 Self::RC_CHANNELS_OVERRIDE(inner) => Some(inner.target_component),
36512 Self::REQUEST_DATA_STREAM(inner) => Some(inner.target_component),
36513 Self::REQUEST_EVENT(inner) => Some(inner.target_component),
36514 Self::RESPONSE_EVENT_ERROR(inner) => Some(inner.target_component),
36515 Self::SAFETY_SET_ALLOWED_AREA(inner) => Some(inner.target_component),
36516 Self::SERIAL_CONTROL(inner) => Some(inner.target_component),
36517 Self::SETUP_SIGNING(inner) => Some(inner.target_component),
36518 Self::SET_ACTUATOR_CONTROL_TARGET(inner) => Some(inner.target_component),
36519 Self::SET_ATTITUDE_TARGET(inner) => Some(inner.target_component),
36520 Self::SET_POSITION_TARGET_GLOBAL_INT(inner) => Some(inner.target_component),
36521 Self::SET_POSITION_TARGET_LOCAL_NED(inner) => Some(inner.target_component),
36522 Self::SUPPORTED_TUNES(inner) => Some(inner.target_component),
36523 Self::TIMESYNC(inner) => Some(inner.target_component),
36524 Self::TUNNEL(inner) => Some(inner.target_component),
36525 Self::V2_EXTENSION(inner) => Some(inner.target_component),
36526 _ => None,
36527 }
36528 }
36529}